How to use the flaky.flaky_pytest_plugin.FlakyXdist function in flaky

To help you get started, we’ve selected a few flaky examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github box / flaky / flaky / flaky_pytest_plugin.py View on Github external
def __init__(self, plugin):
        super(FlakyXdist, self).__init__()
        self._plugin = plugin
github box / flaky / flaky / flaky_pytest_plugin.py View on Github external
Pytest hook to get information about how the test run has been configured.

        :param config:
            The pytest configuration object for this test run.
        :type config:
            :class:`Configuration`
        """
        self.flaky_report = config.option.flaky_report
        self.flaky_success_report = config.option.flaky_success_report
        self.force_flaky = config.option.force_flaky
        self.max_runs = config.option.max_runs
        self.min_passes = config.option.min_passes
        self.runner = config.pluginmanager.getplugin("runner")

        if config.pluginmanager.hasplugin('xdist'):
            config.pluginmanager.register(FlakyXdist(self), name='flaky.xdist')
            self.config = config
        worker_output = _get_worker_output(config)
        if worker_output is not None:
            worker_output['flaky_report'] = ''

        config.addinivalue_line('markers', 'flaky: marks tests to be automatically retried upon failure')