Skip to content

Commit 759639c

Browse files
committed
TST: Change nose.runmodule to pytest
1 parent bacebc3 commit 759639c

File tree

108 files changed

+51869
-307
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

108 files changed

+51869
-307
lines changed

coverage.xml

Lines changed: 51527 additions & 0 deletions
Large diffs are not rendered by default.

fo.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
echo "Linting *.py"
2+
flake8 pandas --filename '*.py' --exclude pandas/rpy,pandas/src
3+
echo "Linting *.py DONE"
4+
5+
echo "Linting *.pyx"
6+
flake8 pandas --filename '*.pyx' --select=E501,E302,E203,E111,E114,E221,E303,E128,E231,E126
7+
echo "Linting *.pyx DONE"
8+
9+
echo "Linting *.pxi.in"
10+
for path in 'src'
11+
do
12+
echo "linting -> pandas/$path"
13+
flake8 pandas/$path --filename '*.pxi.in' --select=E501,E302,E203,E111,E114,E221,E303,E231,E126
14+
if [ $? -ne "0" ]; then
15+
RET=1
16+
fi
17+
18+
done
19+
echo "Linting *.pxi.in DONE"
20+
21+
echo "Check for invalid testing"
22+
grep -r -E --include '*.py' --exclude nosetester.py --exclude testing.py '(numpy|np)\.testing' pandas
23+
if [ $? = "0" ]; then
24+
RET=1
25+
fi
26+
echo "Check for invalid testing DONE"
27+

pandas/api/tests/test_api.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,6 @@ def test_deprecation_access_obj(self):
229229
pd.datetools.monthEnd
230230

231231
if __name__ == '__main__':
232-
import nose
233-
nose.runmodule(argv=[__file__, '-vvs', '-x', '--pdb', '--pdb-failure'],
234-
exit=False)
232+
import pytest
233+
234+
pytest.main([__file__, '-vvs', '-x', '--pdb'])

pandas/computation/tests/test_compat.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,5 +65,6 @@ def testit():
6565

6666

6767
if __name__ == '__main__':
68-
nose.runmodule(argv=[__file__, '-vvs', '-x', '--pdb', '--pdb-failure'],
69-
exit=False)
68+
import pytest
69+
70+
pytest.main([__file__, '-vvs', '-x', '--pdb'])

pandas/computation/tests/test_eval.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1972,5 +1972,6 @@ def test_negate_lt_eq_le():
19721972

19731973

19741974
if __name__ == '__main__':
1975-
nose.runmodule(argv=[__file__, '-vvs', '-x', '--pdb', '--pdb-failure'],
1976-
exit=False)
1975+
import pytest
1976+
1977+
pytest.main([__file__, '-vvs', '-x', '--pdb'])

pandas/core/frame.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5768,6 +5768,6 @@ def boxplot(self, column=None, by=None, ax=None, fontsize=None, rot=0,
57685768
ops.add_special_arithmetic_methods(DataFrame, **ops.frame_special_funcs)
57695769

57705770
if __name__ == '__main__':
5771-
import nose
5772-
nose.runmodule(argv=[__file__, '-vvs', '-x', '--pdb', '--pdb-failure'],
5773-
exit=False)
5771+
import pytest
5772+
5773+
pytest.main([__file__, '-vvs', '-x', '--pdb'])

pandas/io/tests/json/test_json_norm.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
import nose
2-
31
from pandas import DataFrame
42
import numpy as np
53
import json
@@ -226,5 +224,6 @@ def test_nested_flattens(self):
226224
self.assertEqual(result, expected)
227225

228226
if __name__ == '__main__':
229-
nose.runmodule(argv=[__file__, '-vvs', '-x', '--pdb',
230-
'--pdb-failure', '-s'], exit=False)
227+
import pytest
228+
229+
pytest.main([__file__, '-vvs', '-x', '--pdb'])

pandas/io/tests/json/test_pandas.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1013,5 +1013,6 @@ def roundtrip(s, encoding='latin-1'):
10131013

10141014

10151015
if __name__ == '__main__':
1016-
nose.runmodule(argv=[__file__, '-vvs', '-x', '--pdb',
1017-
'--pdb-failure', '-s'], exit=False)
1016+
import pytest
1017+
1018+
pytest.main([__file__, '-vvs', '-x', '--pdb'])

pandas/io/tests/json/test_ujson.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1614,5 +1614,6 @@ def _clean_dict(d):
16141614

16151615

16161616
if __name__ == '__main__':
1617-
nose.runmodule(argv=[__file__, '-vvs', '-x', '--pdb', '--pdb-failure'],
1618-
exit=False)
1617+
import pytest
1618+
1619+
pytest.main([__file__, '-vvs', '-x', '--pdb'])

pandas/io/tests/parser/test_network.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,5 +187,6 @@ def test_s3_fails(self):
187187
read_csv('s3://cant_get_it/')
188188

189189
if __name__ == '__main__':
190-
nose.runmodule(argv=[__file__, '-vvs', '-x', '--pdb', '--pdb-failure'],
191-
exit=False)
190+
import pytest
191+
192+
pytest.main([__file__, '-vvs', '-x', '--pdb'])

0 commit comments

Comments
 (0)