Skip to content

Commit

Permalink
Remove nose support
Browse files Browse the repository at this point in the history
The nose test runner hasn't been actively developed since 2016.

Co-authored by [email protected]
  • Loading branch information
stratakis committed Sep 2, 2023
1 parent 8de75b5 commit c373757
Show file tree
Hide file tree
Showing 13 changed files with 27 additions and 910 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ pip-log.txt
# Unit test / coverage reports
.coverage
.tox
nosetests.xml

# Translations
*.mo
Expand Down
2 changes: 2 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ Release History
Upcoming
++++++++

- nose support has been removed.

3.7.0 (2020-07-07)
++++++++++++++++++

Expand Down
12 changes: 2 additions & 10 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ flaky
About
-----

Flaky is a plugin for nose or pytest that automatically reruns flaky tests.
Flaky is a plugin for pytest that automatically reruns flaky tests.

Ideally, tests reliably pass or fail, but sometimes test fixtures must rely on components that aren't 100%
reliable. With flaky, instead of removing those tests or marking them to @skip, they can be automatically
Expand Down Expand Up @@ -118,12 +118,6 @@ It can also be used to incur a delay between test retries:
Activating the plugin
~~~~~~~~~~~~~~~~~~~~~

Like any nose plugin, flaky can be activated via the command line:

.. code-block:: console
nosetests --with-flaky
With pytest, flaky will automatically run. It can, however be disabled via the command line:

.. code-block:: console
Expand Down Expand Up @@ -152,7 +146,7 @@ Pass ``--max-runs=MAX_RUNS`` and/or ``--min-passes=MIN_PASSES`` to control the b
is specified. Flaky decorators on individual tests will override these defaults.


*Additional usage examples are in the code - see test/test_nose/test_nose_example.py and test/test_pytest/test_pytest_example.py*
*Additional usage examples are in the code - see test/test_pytest/test_pytest_example.py*

Installation
------------
Expand All @@ -169,8 +163,6 @@ Compatibility

Flaky is tested with the following test runners and options:

- Nosetests. Doctests cannot be marked flaky.

- Py.test. Works with ``pytest-xdist`` but not with the ``--boxed`` option. Doctests cannot be marked flaky.


Expand Down
36 changes: 18 additions & 18 deletions flaky/_flaky_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def _should_handle_test_error_or_failure(self, test):
:param test:
The test that has raised an error
:type test:
:class:`nose.case.Test` or :class:`Function`
:class:`Function`
:return:
True, if the test needs to be rerun; False, otherwise.
:rtype:
Expand All @@ -130,7 +130,7 @@ def _will_handle_test_error_or_failure(self, test, name, err):
:param test:
The test that has raised an error
:type test:
:class:`nose.case.Test` or :class:`Function`
:class:`Function`
:param name:
The name of the test that has raised an error
:type name:
Expand Down Expand Up @@ -159,7 +159,7 @@ def _handle_test_error_or_failure(self, test, err):
:param test:
The test that has raised an error
:type test:
:class:`nose.case.Test` or :class:`Function`
:class:`Function`
:param err:
Information about the test failure (from sys.exc_info())
:type err:
Expand Down Expand Up @@ -204,7 +204,7 @@ def _should_rerun_test(self, test, name, err):
:param test:
The test that has raised an error
:type test:
:class:`nose.case.Test` or :class:`Function`
:class:`Function`
:param name:
The test name
:type name:
Expand All @@ -228,7 +228,7 @@ def _mark_test_for_rerun(self, test):
:param test:
The test that has raised an error or succeeded
:type test:
:class:`nose.case.Test` or :class:`Function`
:class:`Function`
"""
raise NotImplementedError # pragma: no cover

Expand All @@ -253,7 +253,7 @@ def _handle_test_success(self, test):
:param test:
The test that has raised an error
:type test:
:class:`nose.case.Test` or :class:`Function`
:class:`Function`
:return:
True, if the test will be rerun; False, if the test runner should handle it.
:rtype:
Expand Down Expand Up @@ -404,7 +404,7 @@ def _copy_flaky_attributes(cls, test, test_class):
:param test:
The test that is being prepared to run
:type test:
:class:`nose.case.Test`
:class:`Function`
"""
test_callable = cls._get_test_callable(test)
if test_callable is None:
Expand All @@ -427,7 +427,7 @@ def _get_flaky_attribute(test_item, flaky_attribute):
:param test_item:
The test method from which to get the attribute
:type test_item:
`callable` or :class:`nose.case.Test` or :class:`Function`
`callable` or :class:`Function`
:param flaky_attribute:
The name of the attribute to get
:type flaky_attribute:
Expand All @@ -449,7 +449,7 @@ def _set_flaky_attribute(test_item, flaky_attribute, value):
:param test_item:
The test callable on which to set the attribute
:type test_item:
`callable` or :class:`nose.case.Test` or :class:`Function`
`callable` or :class:`Function`
:param flaky_attribute:
The name of the attribute to set
:type flaky_attribute:
Expand All @@ -469,7 +469,7 @@ def _increment_flaky_attribute(cls, test_item, flaky_attribute):
:param test_item:
The test callable on which to set the attribute
:type test_item:
`callable` or :class:`nose.case.Test` or :class:`Function`
`callable` or :class:`Function`
:param flaky_attribute:
The name of the attribute to set
:type flaky_attribute:
Expand All @@ -485,7 +485,7 @@ def _has_flaky_attributes(cls, test):
:param test:
The test that is being prepared to run
:type test:
:class:`nose.case.Test` or :class:`Function`
:class:`Function`
:return:
:rtype:
`bool`
Expand All @@ -501,7 +501,7 @@ def _get_flaky_attributes(cls, test_item):
:param test_item:
The test callable from which to get the flaky related attributes.
:type test_item:
`callable` or :class:`nose.case.Test` or :class:`Function`
`callable` or :class:`Function`
:return:
:rtype:
`dict` of `unicode` to varies
Expand All @@ -521,7 +521,7 @@ def _add_flaky_test_failure(cls, test, err):
:param test:
The flaky test on which to update the flaky attributes.
:type test:
:class:`nose.case.Test` or :class:`Function`
:class:`Function`
:param err:
Information about the test failure (from sys.exc_info())
:type err:
Expand Down Expand Up @@ -582,7 +582,7 @@ def _get_test_callable(cls, test):
:param test:
The test that has raised an error or succeeded
:type test:
:class:`nose.case.Test` or :class:`pytest.Item`
:class:`pytest.Item`
:return:
The test declaration, callable and name that is being run
:rtype:
Expand All @@ -598,7 +598,7 @@ def _get_test_callable_name(test):
:param test:
The test that has raised an error or succeeded
:type test:
:class:`nose.case.Test` or :class:`pytest.Item`
:class:`pytest.Item`
:return:
The name of the test callable that is being run by the test
:rtype:
Expand All @@ -614,7 +614,7 @@ def _make_test_flaky(cls, test, max_runs=None, min_passes=None, rerun_filter=Non
:param test:
The test in question.
:type test:
:class:`nose.case.Test` or :class:`Function`
:class:`Function`
:param max_runs:
The value of the FlakyNames.MAX_RUNS attribute to use.
:type max_runs:
Expand All @@ -631,9 +631,9 @@ def _make_test_flaky(cls, test, max_runs=None, min_passes=None, rerun_filter=Non
Information about the test failure (from sys.exc_info())
- name (`unicode`):
The test name
- test (:class:`nose.case.Test` or :class:`Function`):
- test (:class:`Function`):
The test that has raised an error
- plugin (:class:`FlakyNosePlugin` or :class:`FlakyPytestPlugin`):
- plugin (:class:`FlakyPytestPlugin`):
The flaky plugin. Has a :prop:`stream` that can be written to in
order to add to the Flaky Report.
:type rerun_filter:
Expand Down
8 changes: 3 additions & 5 deletions flaky/flaky_decorator.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@

def flaky(max_runs=None, min_passes=None, rerun_filter=None):
"""
Decorator used to mark a test as "flaky". When used in conjunction with
the flaky nosetests plugin, will cause the decorated test to be retried
until min_passes successes are achieved out of up to max_runs test runs.
Decorator used to mark a test as "flaky".
:param max_runs:
The maximum number of times the decorated test will be run.
Expand All @@ -23,9 +21,9 @@ def flaky(max_runs=None, min_passes=None, rerun_filter=None):
Information about the test failure (from sys.exc_info())
- name (`unicode`):
The test name
- test (:class:`nose.case.Test` or :class:`Function`):
- test (:class:`Function`):
The test that has raised an error
- plugin (:class:`FlakyNosePlugin` or :class:`FlakyPytestPlugin`):
- plugin (:class:`FlakyPytestPlugin`):
The flaky plugin. Has a :prop:`stream` that can be written to in
order to add to the Flaky Report.
:type rerun_filter:
Expand Down
Loading

0 comments on commit c373757

Please sign in to comment.