-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
WIP: issue #5325, convert from nose to pytest #5405
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
174 commits
Select commit
Hold shift + click to select a range
4c39e53
ENH: use pytest instead of nose.
pizzathief f10a36b
pytest.raises(), not pytest.raise()
pizzathief c17005b
pytest.raises() calls needed some massaging
pizzathief 1a75b75
replace nose with pytest in INSTALL
pizzathief b123ed7
altering more assert_equal calls.
pizzathief 5f433fb
fixing up problems with assert, and the use of messages.
pizzathief cfb8d71
flake8 failures
pizzathief 89d3366
flake8 doesn't like blank lines at ends of files.
pizzathief 887e482
flake8 fixes
pizzathief 8f16316
fixed syntax errors
pizzathief b56297f
just have it on one line
pizzathief df4e413
fix errors highlighted in travis CI logs
pizzathief defa65d
fixing reported test failures, reported by pytest on travis.
pizzathief b8b3909
fixing pytest failures. Interesting that assert can't seem to handle
pizzathief 5fd4351
fixing syntax failures
pizzathief 47c968b
Force travis to install pytest, and plugins
pizzathief 1b509c1
get travis to run py.test instead of nose.
pizzathief 432e9e8
small pep8 fix to force travis to build
pizzathief 60b038c
lets see if indenting a comment fixes the problem
pizzathief 2984d44
give py.test the install location of the module, rather
pizzathief e27451d
forgot to remove the bad py.test call.
pizzathief 784fdf8
force pytest-pep8 to ignore the pep8 warnings that
pizzathief f035db7
temporarily adding more items to be ignored by pep8,
pizzathief 1e7b62c
trying out --pyargs as requested, also removing pep checks,
pizzathief 56d99ed
tests.py should now act more like the old nose version did,
pizzathief 7d38aa3
lets try the 'gdb python tests.py' method again.
pizzathief 7bbc04a
the switches that nose needed , make pytest fail, so lets
pizzathief 05da48a
pytest.main doesn't like --pyargs now? it used to..
pizzathief 98b1e69
Adding in all tests to the list, including argv[1:]
pizzathief 6853e71
seems --processes=2 and --process-timeout=300
pizzathief 105a15d
replace assert_raises with pytest.raises
pizzathief 5482cc7
another assert_raises to replace with pytest.raises
pizzathief 4a8caad
replace assert_raises with pytest.raises
pizzathief 8985c35
Fixing errors that appear before testing starts
pizzathief 789f864
replaced a nose function for known failing tests
pizzathief 4900796
updating basic tests that are know to fail with
pizzathief 0633576
add the ability to only run pep8 tests. remove commented out means
pizzathief 47ef9f0
ass civerage report as standard
pizzathief 2a7637c
no need for the nose pep8 tests, so remove from tests.py
pizzathief 08ae5ef
pep8 and non-pep8 tests act better now. taking out
pizzathief bd0c061
remove more of the nose infrastructure
pizzathief 42e7ae1
Pass the exit code of pytest.main back to the shell.
pizzathief 86820be
replace nose decorator with pytest code.
pizzathief 37c67c2
whoops, deleted an 'a' from a variable while doing
pizzathief 84359ac
fix up a bunch of pytest.raises calls.
pizzathief c76bef9
found 'assert_less' calls to replace
pizzathief 2e58461
found a space and comma char that had attempted an escape of the faci…
pizzathief 517b232
found some assert_equal statements to convert.
pizzathief 9aee1fc
converted assert_raises calls to pytest.raises.
pizzathief 91f3032
more assert_raises calls to replace
pizzathief 86f7264
Thanks to QuLogic , using decorator form of pytest.raises for
pizzathief f7e7401
more conversions of pytest.raises to use 'with' instead.
pizzathief 6f935ce
change nose method for calling test class methods.
pizzathief 72ddc43
fixing pep8 failures.
pizzathief 2d71f19
more pep8 fixes.
pizzathief 571fbbd
another testing class that needed changes for pytest.
pizzathief 50b0e0a
more pep8 failures to hide under the rug.
pizzathief 4408d10
another pytest.raises to fix.
pizzathief 4e87b72
lets try not comparing the equivilance of empty dicts, but rather
pizzathief 6d3bb58
if commenting out the nose pep8 functions work, then they
pizzathief 4bfbf26
pep8 fixes.
pizzathief 1ffc9c2
fix typos found QuLogic
pizzathief 389ebc3
removing (and moving) import code in tests.py
pizzathief 1f1c2a6
replacing new nose calls with plain asserts
pizzathief 01df455
exclude files from pep8 checking
pizzathief bb3ab51
add support for running a single test module, instead of all of them
pizzathief 73e9383
The "_name.py" files in exclude_files might need globbing to
pizzathief 5f3255b
pep8 failures
pizzathief f4826c3
pep8 was demanding that lambdas be replaced with proper functions.
pizzathief 08ce37b
This is hopefully an acceptable solution to the problem with
pizzathief f705680
pep8 failures
pizzathief 9aac515
remove assert_not_equal
pizzathief 4a62ad9
lets try '--ignore'ing the numpy tests dir
pizzathief df2ebeb
Don't code at night on holidays with bad specs.
pizzathief 1e12273
try norecursedirs to get pytest to stop looking in numpy
pizzathief 47e0c4b
found cases of 'import nose' , and also, use of
pizzathief d04ab5c
needed to specify 'reason=' for xfail to work
pizzathief 57b2f17
need to specify a 'reason=' to use pytest.maek.xfail
pizzathief 636728f
don't need knownfailureif
pizzathief b0a342d
pytest xfail needs a 'reason'
pizzathief 78587c1
fixing up small pytest issues
pizzathief 09e559a
don't need the nose make_decorator function any more.
pizzathief 8c3f2f1
to please the pep8 gods, we sacrifice this line break.
pizzathief 62983b5
replace a knownfailureif call, and fix up pytest xfail calls
pizzathief e83807f
make_decorator seems to be described here.
pizzathief 22ee978
resolve the oeo8 allergy to blank lines,
pizzathief ea7c57f
fix up xfail calls
pizzathief 3008a22
another zfail reason fix
pizzathief 49d2315
typo
pizzathief a1f31a8
don't import from nose , and don't need knownfailure
pizzathief e812aac
remove knownfailureif reference
pizzathief 4fff146
An attempt to make a image_comparison decorator that doesn't fail
pizzathief 738da3e
fix up indentation for import
pizzathief da60028
another fix for indentation. kinda non-dry'y
pizzathief 726cc92
removed mentions of 'import nose'
pizzathief f17a2db
more nose lines to change
pizzathief 683546e
regex assertions to convert
pizzathief 63eae4b
replaced nose.assert_almost_equal with the numpy one, but
pizzathief 6c46f42
basic nose replacement stuff
pizzathief c4a824e
fix up test failures caused through rebase
pizzathief ac14548
add in the ability to filter out numpy files from consideration
pizzathief 3f45e42
fix up test_mlab.py raises and nose import lines
pizzathief 38c29c6
fix test_apply_window_*D* function calls in test_mlab.py
pizzathief fc4e025
fix test_LogLocator in test_ticker.py
pizzathief ade1890
fix lack of pytest import in test_transforms.py
pizzathief 1cbd24a
remove __name__ == '__main__' from many test files
pizzathief 373fa15
PEP8 E301 in test_docstring_addition
pizzathief ca9828a
PEP8 E302 in test_transforms.py, test_transformed_path
pizzathief fa1e601
PEP8 E261 in test_mathtext.py, math_tests[]
pizzathief 534ab6f
PEP8 E712 in test_figure.py, test_fignum_exists
pizzathief db2d85b
PEP8 E302 test_dviread.py around setup_PsfontsMap
pizzathief c4ea6d4
PEP8 E712 in test_axes.py
pizzathief a2291a1
PEP8 E712 in test_artist.py , test_remove
pizzathief 65b42bd
PEP8 W293 in test_labeled_data_unpacking.py, test_docstring_addition
pizzathief 8a22e2a
fix bad pytest raises calls in test_triangulation.py
pizzathief 6ed71fa
fix bad pytest.raises calls in test_cbook.py test_step_fails
pizzathief f78c075
fix bad assert calls in test_pickle.py , test_transform
pizzathief 1d7b37c
fix bad pytest.raises calls in test_colors.py, test_colors_no_float
pizzathief 90bbe25
fix pytest.raises call in test_colors.py test_cmap_and_norm_from_leve…
pizzathief ee30e10
fix rebase omission, test_transform in test_pickle.py
pizzathief 35520a4
fix user searh, not match in test_labeled_data_unpacking, test_docstr…
pizzathief b3c7dda
fix test_invalid_input_forms in test_cycles.py
pizzathief 331428f
fix nose skiptest references, test_axes.py
pizzathief ea38ba6
remove nose import references, many files
pizzathief 2cb6b8c
PEP8 E302 at test_gridspec.py
pizzathief accbcf2
doc convert nose docs to pytest, testing.rst
pizzathief a4ddff3
fix remove nose install from travis
pizzathief bd5828f
fix syntax error (newline) in testing.rst
pizzathief 930c529
fix numpy pytest errors. don't put pylab in default namespace
pizzathief ae9715c
ENH: use pytest instead of nose.
pizzathief edabe74
pytest.raises(), not pytest.raise()
pizzathief 23d6fae
pytest.raises() calls needed some massaging
pizzathief f27909a
fixing up problems with assert, and the use of messages.
pizzathief a023347
fix errors highlighted in travis CI logs
pizzathief dd8111b
fixing pytest failures. Interesting that assert can't seem to handle
pizzathief 9f53f57
fixing syntax failures
pizzathief eefe67d
force pytest-pep8 to ignore the pep8 warnings that
pizzathief 2661e32
the switches that nose needed , make pytest fail, so lets
pizzathief f404baa
another assert_raises to replace with pytest.raises
pizzathief 53457e9
replaced a nose function for known failing tests
pizzathief 0f9fae8
remove more of the nose infrastructure
pizzathief cd961cc
fix up a bunch of pytest.raises calls.
pizzathief de69032
converted assert_raises calls to pytest.raises.
pizzathief 42185f8
fixing pep8 failures.
pizzathief cd81fbf
more pep8 failures to hide under the rug.
pizzathief 523bb86
if commenting out the nose pep8 functions work, then they
pizzathief 859f8d5
removing (and moving) import code in tests.py
pizzathief ad48b37
pep8 failures
pizzathief 9a0b134
try norecursedirs to get pytest to stop looking in numpy
pizzathief 23cee6a
found cases of 'import nose' , and also, use of
pizzathief c59a7b0
don't need the nose make_decorator function any more.
pizzathief 43fd3e2
make_decorator seems to be described here.
pizzathief 108522a
An attempt to make a image_comparison decorator that doesn't fail
pizzathief 90221b9
fix up indentation for import
pizzathief 6f74d88
another fix for indentation. kinda non-dry'y
pizzathief 0ba7323
removed mentions of 'import nose'
pizzathief 39612f6
fix up test failures caused through rebase
pizzathief 336d1eb
remove __name__ == '__main__' from many test files
pizzathief 7d9fdf6
fix test_invalid_input_forms in test_cycles.py
pizzathief 606907b
fix nose skiptest references, test_axes.py
pizzathief db5f5e5
fix numpy pytest errors. don't put pylab in default namespace
pizzathief 37418d8
PEP8 E502 at test_simplification.py, test_fft_peaks
pizzathief 01b9215
remove @cleanup operator from test_complete. Its causing a pytest
pizzathief b9c0ee7
PEP8 E302 around teardown_PsfontsMap, test_dviread.py
pizzathief e002e48
fix lack of _func error in image_comparison_2, decorators.py
pizzathief 25f77bc
fix assert_raises call in test_valid_linestyles, test_lines.py
pizzathief 1996513
fix syntax error (another newline) in testing.rst, rst files
pizzathief 07313db
doc lets remove pytest targets in rst for now
pizzathief 280be1b
convert pytest.raises(error,f,x,y) calls to with pytest.raises
pizzathief a135e56
fix test_positional_parameter_names_as_function , seems getting a
pizzathief e52e0fc
PEP8 E201 in test_stride_windows_0D_ValueError, test_mlab.py
pizzathief d2f4e6b
as requested, push a simple change to test appveyor
pizzathief bf19dad
trying to get pytest to recognise dynamically created test
pizzathief f111193
make tests.py handle single modules better
pizzathief File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import pytest | ||
""" | ||
So pytest is trying to load tests in numpy, and generates this error | ||
|
||
____________________________ ERROR at setup of test ____________________________ | ||
file /home/travis/build/matplotlib/matplotlib/venv/lib/python2.7/site-packages/ | ||
numpy/testing/nosetester.py, line 249 | ||
def test(self, label='fast', verbose=1, extra_argv=None, doctests=False, | ||
fixture 'self' not found | ||
available fixtures: tmpdir_factory, pytestconfig, cov, cache, recwarn, | ||
monkeypatch, record_xml_property, capfd, capsys, tmpdir | ||
|
||
use 'py.test --fixtures [testpath]' for help on them. | ||
/home/travis/build/matplotlib/matplotlib/venv/lib/python2.7/site-packages/ | ||
numpy/testing/nosetester.py:249 | ||
|
||
this file is intended to stop that behaviour, by blocking files from | ||
being considered for collection if "numpy" is in the path | ||
""" | ||
|
||
def pytest_ignore_collect(path, config): | ||
if 'numpy' not in path.basename: | ||
print('allowing ', path) | ||
return True | ||
else: | ||
print('blocking ', path) | ||
return False | ||
|
||
# return 'numpy' not in path.basename: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the right place to install them. You could put them all on one line:
pip install pytest pytest-cov pytest-pep8