How to use the flaky.flaky_pytest_plugin.FlakyPlugin 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 / test / test_pytest / test_flaky_pytest_plugin.py View on Github external
def flaky_plugin(mock_io):
    # pylint:disable=unused-argument
    return FlakyPlugin()
github box / flaky / flaky / flaky_pytest_plugin.py View on Github external
printed by the plugin's report method.
        """
        self._stream.writelines([
            ensure_unicode_string(test_callable_name),
            message,
            '\n\t',
            ensure_unicode_string(err[0]),
            '\n\t',
            ensure_unicode_string(err[1]),
            '\n\t',
            ensure_unicode_string(err[2]),
            '\n',
        ])


PLUGIN = FlakyPlugin()
# pytest only processes hooks defined on the module
# find all hooks defined on the plugin class and copy them to the module globals
for _pytest_hook in dir(PLUGIN):
    if _pytest_hook.startswith('pytest_'):
        globals()[_pytest_hook] = getattr(PLUGIN, _pytest_hook)