How to use the flaky.flaky_nose_plugin 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 _assert_flaky_plugin_configured(self):
        options = Mock()
        options.multiprocess_workers = 0
        conf = Mock()
        self._flaky_plugin.enabled = True
        with patch.object(flaky_nose_plugin, 'TextTestResult') as flaky_result:
            flaky_result.return_value = self._mock_test_result
            from io import StringIO
            self._mock_stream = MagicMock(spec=StringIO)
            with patch.object(self._flaky_plugin, '_get_stream') as get_stream:
                get_stream.return_value = self._mock_stream
                self._flaky_plugin.configure(options, conf)
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
        )