Skip to content

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
wants to merge 174 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
174 commits
Select commit Hold shift + click to select a range
4c39e53
ENH: use pytest instead of nose.
pizzathief Oct 31, 2015
f10a36b
pytest.raises(), not pytest.raise()
pizzathief Nov 4, 2015
c17005b
pytest.raises() calls needed some massaging
pizzathief Nov 4, 2015
1a75b75
replace nose with pytest in INSTALL
pizzathief Nov 4, 2015
b123ed7
altering more assert_equal calls.
pizzathief Nov 4, 2015
5f433fb
fixing up problems with assert, and the use of messages.
pizzathief Nov 5, 2015
cfb8d71
flake8 failures
pizzathief Nov 5, 2015
89d3366
flake8 doesn't like blank lines at ends of files.
pizzathief Nov 5, 2015
887e482
flake8 fixes
pizzathief Nov 5, 2015
8f16316
fixed syntax errors
pizzathief Nov 5, 2015
b56297f
just have it on one line
pizzathief Nov 5, 2015
df4e413
fix errors highlighted in travis CI logs
pizzathief Nov 5, 2015
defa65d
fixing reported test failures, reported by pytest on travis.
pizzathief Nov 5, 2015
b8b3909
fixing pytest failures. Interesting that assert can't seem to handle
pizzathief Nov 5, 2015
5fd4351
fixing syntax failures
pizzathief Nov 5, 2015
47c968b
Force travis to install pytest, and plugins
pizzathief Nov 5, 2015
1b509c1
get travis to run py.test instead of nose.
pizzathief Nov 6, 2015
432e9e8
small pep8 fix to force travis to build
pizzathief Nov 6, 2015
60b038c
lets see if indenting a comment fixes the problem
pizzathief Nov 6, 2015
2984d44
give py.test the install location of the module, rather
pizzathief Nov 7, 2015
e27451d
forgot to remove the bad py.test call.
pizzathief Nov 7, 2015
784fdf8
force pytest-pep8 to ignore the pep8 warnings that
pizzathief Nov 7, 2015
f035db7
temporarily adding more items to be ignored by pep8,
pizzathief Nov 7, 2015
1e7b62c
trying out --pyargs as requested, also removing pep checks,
pizzathief Nov 7, 2015
56d99ed
tests.py should now act more like the old nose version did,
pizzathief Nov 8, 2015
7d38aa3
lets try the 'gdb python tests.py' method again.
pizzathief Nov 8, 2015
7bbc04a
the switches that nose needed , make pytest fail, so lets
pizzathief Nov 8, 2015
05da48a
pytest.main doesn't like --pyargs now? it used to..
pizzathief Nov 9, 2015
98b1e69
Adding in all tests to the list, including argv[1:]
pizzathief Nov 13, 2015
6853e71
seems --processes=2 and --process-timeout=300
pizzathief Nov 13, 2015
105a15d
replace assert_raises with pytest.raises
pizzathief Nov 13, 2015
5482cc7
another assert_raises to replace with pytest.raises
pizzathief Nov 13, 2015
4a8caad
replace assert_raises with pytest.raises
pizzathief Nov 13, 2015
8985c35
Fixing errors that appear before testing starts
pizzathief Nov 13, 2015
789f864
replaced a nose function for known failing tests
pizzathief Nov 13, 2015
4900796
updating basic tests that are know to fail with
pizzathief Nov 14, 2015
0633576
add the ability to only run pep8 tests. remove commented out means
pizzathief Nov 18, 2015
47ef9f0
ass civerage report as standard
pizzathief Nov 18, 2015
2a7637c
no need for the nose pep8 tests, so remove from tests.py
pizzathief Nov 18, 2015
08ae5ef
pep8 and non-pep8 tests act better now. taking out
pizzathief Nov 25, 2015
bd0c061
remove more of the nose infrastructure
pizzathief Nov 27, 2015
42e7ae1
Pass the exit code of pytest.main back to the shell.
pizzathief Dec 13, 2015
86820be
replace nose decorator with pytest code.
pizzathief Dec 13, 2015
37c67c2
whoops, deleted an 'a' from a variable while doing
pizzathief Dec 13, 2015
84359ac
fix up a bunch of pytest.raises calls.
pizzathief Dec 13, 2015
c76bef9
found 'assert_less' calls to replace
pizzathief Dec 13, 2015
2e58461
found a space and comma char that had attempted an escape of the faci…
pizzathief Dec 13, 2015
517b232
found some assert_equal statements to convert.
pizzathief Dec 13, 2015
9aee1fc
converted assert_raises calls to pytest.raises.
pizzathief Dec 13, 2015
91f3032
more assert_raises calls to replace
pizzathief Dec 13, 2015
86f7264
Thanks to QuLogic , using decorator form of pytest.raises for
pizzathief Dec 13, 2015
f7e7401
more conversions of pytest.raises to use 'with' instead.
pizzathief Dec 13, 2015
6f935ce
change nose method for calling test class methods.
pizzathief Dec 14, 2015
72ddc43
fixing pep8 failures.
pizzathief Dec 14, 2015
2d71f19
more pep8 fixes.
pizzathief Dec 14, 2015
571fbbd
another testing class that needed changes for pytest.
pizzathief Dec 14, 2015
50b0e0a
more pep8 failures to hide under the rug.
pizzathief Dec 14, 2015
4408d10
another pytest.raises to fix.
pizzathief Dec 14, 2015
4e87b72
lets try not comparing the equivilance of empty dicts, but rather
pizzathief Dec 14, 2015
6d3bb58
if commenting out the nose pep8 functions work, then they
pizzathief Dec 14, 2015
4bfbf26
pep8 fixes.
pizzathief Dec 14, 2015
1ffc9c2
fix typos found QuLogic
pizzathief Dec 14, 2015
389ebc3
removing (and moving) import code in tests.py
pizzathief Dec 15, 2015
1f1c2a6
replacing new nose calls with plain asserts
pizzathief Dec 15, 2015
01df455
exclude files from pep8 checking
pizzathief Dec 15, 2015
bb3ab51
add support for running a single test module, instead of all of them
pizzathief Dec 21, 2015
73e9383
The "_name.py" files in exclude_files might need globbing to
pizzathief Dec 28, 2015
5f3255b
pep8 failures
pizzathief Dec 28, 2015
f4826c3
pep8 was demanding that lambdas be replaced with proper functions.
pizzathief Dec 28, 2015
08ce37b
This is hopefully an acceptable solution to the problem with
pizzathief Dec 28, 2015
f705680
pep8 failures
pizzathief Dec 28, 2015
9aac515
remove assert_not_equal
pizzathief Dec 28, 2015
4a62ad9
lets try '--ignore'ing the numpy tests dir
pizzathief Dec 31, 2015
df2ebeb
Don't code at night on holidays with bad specs.
pizzathief Dec 31, 2015
1e12273
try norecursedirs to get pytest to stop looking in numpy
pizzathief Jan 1, 2016
47e0c4b
found cases of 'import nose' , and also, use of
pizzathief Jan 2, 2016
d04ab5c
needed to specify 'reason=' for xfail to work
pizzathief Jan 2, 2016
57b2f17
need to specify a 'reason=' to use pytest.maek.xfail
pizzathief Jan 2, 2016
636728f
don't need knownfailureif
pizzathief Jan 2, 2016
b0a342d
pytest xfail needs a 'reason'
pizzathief Jan 2, 2016
78587c1
fixing up small pytest issues
pizzathief Jan 2, 2016
09e559a
don't need the nose make_decorator function any more.
pizzathief Jan 4, 2016
8c3f2f1
to please the pep8 gods, we sacrifice this line break.
pizzathief Jan 4, 2016
62983b5
replace a knownfailureif call, and fix up pytest xfail calls
pizzathief Jan 4, 2016
e83807f
make_decorator seems to be described here.
pizzathief Jan 4, 2016
22ee978
resolve the oeo8 allergy to blank lines,
pizzathief Jan 4, 2016
ea7c57f
fix up xfail calls
pizzathief Jan 4, 2016
3008a22
another zfail reason fix
pizzathief Jan 4, 2016
49d2315
typo
pizzathief Jan 4, 2016
a1f31a8
don't import from nose , and don't need knownfailure
pizzathief Jan 5, 2016
e812aac
remove knownfailureif reference
pizzathief Jan 5, 2016
4fff146
An attempt to make a image_comparison decorator that doesn't fail
pizzathief Jan 8, 2016
738da3e
fix up indentation for import
pizzathief Jan 8, 2016
da60028
another fix for indentation. kinda non-dry'y
pizzathief Jan 8, 2016
726cc92
removed mentions of 'import nose'
pizzathief Jan 11, 2016
f17a2db
more nose lines to change
pizzathief Jan 11, 2016
683546e
regex assertions to convert
pizzathief Jan 11, 2016
63eae4b
replaced nose.assert_almost_equal with the numpy one, but
pizzathief Jan 11, 2016
6c46f42
basic nose replacement stuff
pizzathief Jan 11, 2016
c4a824e
fix up test failures caused through rebase
pizzathief Jan 14, 2016
ac14548
add in the ability to filter out numpy files from consideration
pizzathief Jan 15, 2016
3f45e42
fix up test_mlab.py raises and nose import lines
pizzathief Jan 17, 2016
38c29c6
fix test_apply_window_*D* function calls in test_mlab.py
pizzathief Jan 17, 2016
fc4e025
fix test_LogLocator in test_ticker.py
pizzathief Jan 17, 2016
ade1890
fix lack of pytest import in test_transforms.py
pizzathief Jan 17, 2016
1cbd24a
remove __name__ == '__main__' from many test files
pizzathief Jan 17, 2016
373fa15
PEP8 E301 in test_docstring_addition
pizzathief Jan 17, 2016
ca9828a
PEP8 E302 in test_transforms.py, test_transformed_path
pizzathief Jan 17, 2016
fa1e601
PEP8 E261 in test_mathtext.py, math_tests[]
pizzathief Jan 17, 2016
534ab6f
PEP8 E712 in test_figure.py, test_fignum_exists
pizzathief Jan 18, 2016
db2d85b
PEP8 E302 test_dviread.py around setup_PsfontsMap
pizzathief Jan 18, 2016
c4ea6d4
PEP8 E712 in test_axes.py
pizzathief Jan 18, 2016
a2291a1
PEP8 E712 in test_artist.py , test_remove
pizzathief Jan 18, 2016
65b42bd
PEP8 W293 in test_labeled_data_unpacking.py, test_docstring_addition
pizzathief Jan 18, 2016
8a22e2a
fix bad pytest raises calls in test_triangulation.py
pizzathief Jan 18, 2016
6ed71fa
fix bad pytest.raises calls in test_cbook.py test_step_fails
pizzathief Jan 18, 2016
f78c075
fix bad assert calls in test_pickle.py , test_transform
pizzathief Jan 18, 2016
1d7b37c
fix bad pytest.raises calls in test_colors.py, test_colors_no_float
pizzathief Jan 18, 2016
90bbe25
fix pytest.raises call in test_colors.py test_cmap_and_norm_from_leve…
pizzathief Jan 18, 2016
ee30e10
fix rebase omission, test_transform in test_pickle.py
pizzathief Jan 18, 2016
35520a4
fix user searh, not match in test_labeled_data_unpacking, test_docstr…
pizzathief Jan 18, 2016
b3c7dda
fix test_invalid_input_forms in test_cycles.py
pizzathief Jan 18, 2016
331428f
fix nose skiptest references, test_axes.py
pizzathief Jan 18, 2016
ea38ba6
remove nose import references, many files
pizzathief Jan 18, 2016
2cb6b8c
PEP8 E302 at test_gridspec.py
pizzathief Jan 18, 2016
accbcf2
doc convert nose docs to pytest, testing.rst
pizzathief Jan 19, 2016
a4ddff3
fix remove nose install from travis
pizzathief Jan 19, 2016
bd5828f
fix syntax error (newline) in testing.rst
pizzathief Jan 19, 2016
930c529
fix numpy pytest errors. don't put pylab in default namespace
pizzathief Jan 19, 2016
ae9715c
ENH: use pytest instead of nose.
pizzathief Oct 31, 2015
edabe74
pytest.raises(), not pytest.raise()
pizzathief Nov 4, 2015
23d6fae
pytest.raises() calls needed some massaging
pizzathief Nov 4, 2015
f27909a
fixing up problems with assert, and the use of messages.
pizzathief Nov 5, 2015
a023347
fix errors highlighted in travis CI logs
pizzathief Nov 5, 2015
dd8111b
fixing pytest failures. Interesting that assert can't seem to handle
pizzathief Nov 5, 2015
9f53f57
fixing syntax failures
pizzathief Nov 5, 2015
eefe67d
force pytest-pep8 to ignore the pep8 warnings that
pizzathief Nov 7, 2015
2661e32
the switches that nose needed , make pytest fail, so lets
pizzathief Nov 8, 2015
f404baa
another assert_raises to replace with pytest.raises
pizzathief Nov 13, 2015
53457e9
replaced a nose function for known failing tests
pizzathief Nov 13, 2015
0f9fae8
remove more of the nose infrastructure
pizzathief Nov 27, 2015
cd961cc
fix up a bunch of pytest.raises calls.
pizzathief Dec 13, 2015
de69032
converted assert_raises calls to pytest.raises.
pizzathief Dec 13, 2015
42185f8
fixing pep8 failures.
pizzathief Dec 14, 2015
cd81fbf
more pep8 failures to hide under the rug.
pizzathief Dec 14, 2015
523bb86
if commenting out the nose pep8 functions work, then they
pizzathief Dec 14, 2015
859f8d5
removing (and moving) import code in tests.py
pizzathief Dec 15, 2015
ad48b37
pep8 failures
pizzathief Dec 28, 2015
9a0b134
try norecursedirs to get pytest to stop looking in numpy
pizzathief Jan 1, 2016
23cee6a
found cases of 'import nose' , and also, use of
pizzathief Jan 2, 2016
c59a7b0
don't need the nose make_decorator function any more.
pizzathief Jan 4, 2016
43fd3e2
make_decorator seems to be described here.
pizzathief Jan 4, 2016
108522a
An attempt to make a image_comparison decorator that doesn't fail
pizzathief Jan 8, 2016
90221b9
fix up indentation for import
pizzathief Jan 8, 2016
6f74d88
another fix for indentation. kinda non-dry'y
pizzathief Jan 8, 2016
0ba7323
removed mentions of 'import nose'
pizzathief Jan 11, 2016
39612f6
fix up test failures caused through rebase
pizzathief Jan 14, 2016
336d1eb
remove __name__ == '__main__' from many test files
pizzathief Jan 17, 2016
7d9fdf6
fix test_invalid_input_forms in test_cycles.py
pizzathief Jan 18, 2016
606907b
fix nose skiptest references, test_axes.py
pizzathief Jan 18, 2016
db5f5e5
fix numpy pytest errors. don't put pylab in default namespace
pizzathief Jan 19, 2016
37418d8
PEP8 E502 at test_simplification.py, test_fft_peaks
pizzathief Jan 19, 2016
01b9215
remove @cleanup operator from test_complete. Its causing a pytest
pizzathief Jan 21, 2016
b9c0ee7
PEP8 E302 around teardown_PsfontsMap, test_dviread.py
pizzathief Jan 22, 2016
e002e48
fix lack of _func error in image_comparison_2, decorators.py
pizzathief Jan 22, 2016
25f77bc
fix assert_raises call in test_valid_linestyles, test_lines.py
pizzathief Jan 22, 2016
1996513
fix syntax error (another newline) in testing.rst, rst files
pizzathief Jan 22, 2016
07313db
doc lets remove pytest targets in rst for now
pizzathief Jan 22, 2016
280be1b
convert pytest.raises(error,f,x,y) calls to with pytest.raises
pizzathief Jan 23, 2016
a135e56
fix test_positional_parameter_names_as_function , seems getting a
pizzathief Jan 23, 2016
e52e0fc
PEP8 E201 in test_stride_windows_0D_ValueError, test_mlab.py
pizzathief Jan 23, 2016
d2f4e6b
as requested, push a simple change to test appveyor
pizzathief Feb 8, 2016
bf19dad
trying to get pytest to recognise dynamically created test
pizzathief Feb 10, 2016
f111193
make tests.py handle single modules better
pizzathief Feb 10, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
removed mentions of 'import nose'
  • Loading branch information
pizzathief committed Jan 22, 2016
commit 0ba73236bce2068c371fc34d6acaca929576e24c
2 changes: 1 addition & 1 deletion lib/matplotlib/tests/test_coding_standards.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def get_file_results(self):
# """
#
# if not HAS_PEP8:
# raise SkipTest('The pep8 tool is required for this test')
# raise pytest.skip('The pep8 tool is required for this test')
#
# # to get a list of bad files, rather than the specific errors, add
# # "reporter=pep8.FileReport" to the StyleGuide constructor.
Expand Down
12 changes: 6 additions & 6 deletions lib/matplotlib/tests/test_cycles.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,15 +172,15 @@ def test_cycle_reset():
@cleanup
def test_invalid_input_forms():
fig, ax = plt.subplots()
with pytest.raises((TypeError, ValueError)):
with pytest.raises(TypeError, ValueError):
ax.set_prop_cycle(1)
with pytest.raises((TypeError, ValueError)):
with pytest.raises(TypeError, ValueError):
ax.set_prop_cycle([1, 2])
with pytest.raises((TypeError, ValueError)):
with pytest.raises(TypeError, ValueError):
ax.set_prop_cycle('color', 'fish')
with pytest.raises((TypeError, ValueError)):
with pytest.raises(TypeError, ValueError):
ax.set_prop_cycle('linewidth', 1)
with pytest.raises((TypeError, ValueError)):
with pytest.raises(TypeError, ValueError):
ax.set_prop_cycle('linewidth', {'1': 1, '2': 2})
with pytest.raises((TypeError, ValueError)):
with pytest.raises(TypeError, ValueError):
ax.set_prop_cycle(linewidth=1, color='r')
2 changes: 2 additions & 0 deletions lib/matplotlib/tests/test_dviread.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ def fin():
teardown_PsfontsMap()
request.addfinalizer(fin)

def teardown_PsfontsMap():
dr.find_tex_file = original_find_tex_file

def test_PsfontsMap(setup_PsfontsMap):
filename = os.path.join(
Expand Down
3 changes: 0 additions & 3 deletions lib/matplotlib/tests/test_rcparams.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,6 @@
from matplotlib.tests import assert_str_equal
from matplotlib.testing.decorators import cleanup
import matplotlib.colors as mcolors
# from nose.tools import assert_true, assert_raises, assert_equal
# from nose.plugins.skip import SkipTest
# import nose
from itertools import chain
import numpy as np
from matplotlib.rcsetup import (validate_bool_maybe_none,
Expand Down