How to use the flaky.flaky_nose_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_nose / test_flaky_nose_plugin.py View on Github external
def setUp(self):
        super(TestFlakyNosePlugin, self).setUp()

        self._mock_test_result = MagicMock()
        self._mock_stream = None
        self._flaky_plugin = flaky_nose_plugin.FlakyPlugin()
        self._mock_nose_result = Mock(flaky_nose_plugin.TextTestResult)
        self._flaky_plugin.prepareTestResult(self._mock_nose_result)
        self._mock_test = MagicMock(name='flaky_plugin_test')
        self._mock_test_case = MagicMock(
            name='flaky_plugin_test_case',
            spec=TestCase
        )
        self._mock_test_case.address = MagicMock()
        self._mock_test_case.test = self._mock_test
        self._mock_test_module_name = 'test_module'
        self._mock_test_class_name = 'TestClass'
        self._mock_test_method_name = 'test_method'
        self._mock_test_names = '{}:{}.{}'.format(
            self._mock_test_module_name,
            self._mock_test_class_name,
            self._mock_test_method_name
github mottosso / cmdx / run_tests.py View on Github external
"--verbose",
        "--with-doctest",

        "--with-flaky",
        "--with-coverage",
        "--cover-html",
        "--cover-package", "cmdx",
        "--cover-erase",
        "--cover-tests",

        "tests.py",
        "test_performance.py",
        "cmdx.py",
    ])

    nose.main(argv=argv, addplugins=[flaky.FlakyPlugin()])

    if os.getenv("TRAVIS_JOB_ID"):
        import coveralls
        coveralls.wear()
    else:
        sys.stdout.write("Skipping coveralls")
github box / flaky / flaky / flaky_nose_plugin.py View on Github external
def options(self, parser, env=os.environ):
        """
        Base class override.
        Add options to the nose argument parser.
        """
        # pylint:disable=dangerous-default-value
        super(FlakyPlugin, self).options(parser, env=env)
        self.add_report_option(parser.add_option)
        group = OptionGroup(
            parser, "Force flaky", "Force all tests to be flaky.")
        self.add_force_flaky_options(group.add_option)
        parser.add_option_group(group)