Skip to content

Commit e21ded6

Browse files
committed
TST: Change nose.runmodule to pytest
1 parent f0891f9 commit e21ded6

File tree

106 files changed

+315
-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.

106 files changed

+315
-307
lines changed

pandas/api/tests/test_api.py

+3-3
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

+3-2
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

+3-2
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

+3-3
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

+3-4
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

+3-2
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

+3-2
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

+3-2
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'])

pandas/io/tests/parser/test_parsers.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
# -*- coding: utf-8 -*-
22

33
import os
4-
import nose
54

65
import pandas.util.testing as tm
76

@@ -98,5 +97,6 @@ def read_table(self, *args, **kwds):
9897
return read_table(*args, **kwds)
9998

10099
if __name__ == '__main__':
101-
nose.runmodule(argv=[__file__, '-vvs', '-x', '--pdb', '--pdb-failure'],
102-
exit=False)
100+
import pytest
101+
102+
pytest.main([__file__, '-vvs', '-x', '--pdb'])

pandas/io/tests/parser/test_textreader.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
import os
1212
import sys
13-
import nose
1413

1514
from numpy import nan
1615
import numpy as np
@@ -398,5 +397,6 @@ def assert_array_dicts_equal(left, right):
398397
assert(np.array_equal(v, right[k]))
399398

400399
if __name__ == '__main__':
401-
nose.runmodule(argv=[__file__, '-vvs', '-x', '--pdb', '--pdb-failure'],
402-
exit=False)
400+
import pytest
401+
402+
pytest.main([__file__, '-vvs', '-x', '--pdb'])

pandas/io/tests/parser/test_unsupported.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
test suite as new feature support is added to the parsers.
1010
"""
1111

12-
import nose
13-
1412
import pandas.io.parsers as parsers
1513
import pandas.util.testing as tm
1614

@@ -150,5 +148,6 @@ def test_deprecated_args(self):
150148
**kwargs)
151149

152150
if __name__ == '__main__':
153-
nose.runmodule(argv=[__file__, '-vvs', '-x', '--pdb', '--pdb-failure'],
154-
exit=False)
151+
import pytest
152+
153+
pytest.main([__file__, '-vvs', '-x', '--pdb'])

pandas/io/tests/test_date_converters.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
from pandas.compat import StringIO
22
from datetime import date, datetime
33

4-
import nose
5-
64
import numpy as np
75

86
from pandas import DataFrame, MultiIndex
@@ -139,5 +137,6 @@ def date_parser(date, time):
139137
assert_frame_equal(df, df_correct)
140138

141139
if __name__ == '__main__':
142-
nose.runmodule(argv=[__file__, '-vvs', '-x', '--pdb', '--pdb-failure'],
143-
exit=False)
140+
import pytest
141+
142+
pytest.main([__file__, '-vvs', '-x', '--pdb'])

pandas/io/tests/test_excel.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -2277,5 +2277,6 @@ def check_called(func):
22772277

22782278

22792279
if __name__ == '__main__':
2280-
nose.runmodule(argv=[__file__, '-vvs', '-x', '--pdb', '--pdb-failure'],
2281-
exit=False)
2280+
import pytest
2281+
2282+
pytest.main([__file__, '-vvs', '-x', '--pdb'])

pandas/io/tests/test_ga.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -194,5 +194,6 @@ def test_segment(self):
194194

195195

196196
if __name__ == '__main__':
197-
nose.runmodule(argv=[__file__, '-vvs', '-x', '--pdb', '--pdb-failure'],
198-
exit=False)
197+
import pytest
198+
199+
pytest.main([__file__, '-vvs', '-x', '--pdb'])

pandas/io/tests/test_gbq.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -1138,5 +1138,6 @@ def test_upload_data_as_service_account_with_key_contents(self):
11381138
self.assertEqual(result['NUM_ROWS'][0], test_size)
11391139

11401140
if __name__ == '__main__':
1141-
nose.runmodule(argv=[__file__, '-vvs', '-x', '--pdb', '--pdb-failure'],
1142-
exit=False)
1141+
import pytest
1142+
1143+
pytest.main([__file__, '-vvs', '-x', '--pdb'])

pandas/io/tests/test_html.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -920,5 +920,6 @@ def test_same_ordering():
920920
assert_framelist_equal(dfs_lxml, dfs_bs4)
921921

922922
if __name__ == '__main__':
923-
nose.runmodule(argv=[__file__, '-vvs', '-x', '--pdb', '--pdb-failure'],
924-
exit=False)
923+
import pytest
924+
925+
pytest.main([__file__, '-vvs', '-x', '--pdb'])

pandas/io/tests/test_pickle.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,6 @@ def test_pickle_v0_15_2(self):
288288

289289

290290
if __name__ == '__main__':
291-
nose.runmodule(argv=[__file__, '-vvs', '-x', '--pdb', '--pdb-failure'],
292-
# '--with-coverage', '--cover-package=pandas.core'],
293-
exit=False)
291+
import pytest
292+
293+
pytest.main([__file__, '-vvs', '-x', '--pdb'])

pandas/io/tests/test_pytables.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -5455,6 +5455,6 @@ def _test_sort(obj):
54555455

54565456

54575457
if __name__ == '__main__':
5458-
import nose
5459-
nose.runmodule(argv=[__file__, '-vvs', '-x', '--pdb', '--pdb-failure'],
5460-
exit=False)
5458+
import pytest
5459+
5460+
pytest.main([__file__, '-vvs', '-x', '--pdb'])

pandas/io/tests/test_s3.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import nose
21
from pandas.util import testing as tm
32

43
from pandas.io.common import _is_s3_url
@@ -10,5 +9,6 @@ def test_is_s3_url(self):
109
self.assertFalse(_is_s3_url("s4://pandas/somethingelse.com"))
1110

1211
if __name__ == '__main__':
13-
nose.runmodule(argv=[__file__, '-vvs', '-x', '--pdb', '--pdb-failure'],
14-
exit=False)
12+
import pytest
13+
14+
pytest.main([__file__, '-vvs', '-x', '--pdb'])

pandas/io/tests/test_sql.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -2664,5 +2664,6 @@ def clean_up(test_table_to_drop):
26642664

26652665

26662666
if __name__ == '__main__':
2667-
nose.runmodule(argv=[__file__, '-vvs', '-x', '--pdb', '--pdb-failure'],
2668-
exit=False)
2667+
import pytest
2668+
2669+
pytest.main([__file__, '-vvs', '-x', '--pdb'])

pandas/io/tests/test_stata.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -1236,5 +1236,6 @@ def test_stata_111(self):
12361236

12371237

12381238
if __name__ == '__main__':
1239-
nose.runmodule(argv=[__file__, '-vvs', '-x', '--pdb', '--pdb-failure'],
1240-
exit=False)
1239+
import pytest
1240+
1241+
pytest.main([__file__, '-vvs', '-x', '--pdb'])

pandas/rpy/tests/test_common.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,6 @@ def test_factor(self):
211211
assert np.equal(result, factors)
212212

213213
if __name__ == '__main__':
214-
nose.runmodule(argv=[__file__, '-vvs', '-x', '--pdb', '--pdb-failure'],
215-
# '--with-coverage', '--cover-package=pandas.core'],
216-
exit=False)
214+
import pytest
215+
216+
pytest.main([__file__, '-vvs', '-x', '--pdb'])

pandas/sparse/tests/test_array.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -797,6 +797,6 @@ def test_ufunc_args(self):
797797

798798

799799
if __name__ == '__main__':
800-
import nose
801-
nose.runmodule(argv=[__file__, '-vvs', '-x', '--pdb', '--pdb-failure'],
802-
exit=False)
800+
import pytest
801+
802+
pytest.main([__file__, '-vvs', '-x', '--pdb'])

pandas/sparse/tests/test_combine_concat.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -360,5 +360,6 @@ def test_concat_sparse_dense(self):
360360

361361
if __name__ == '__main__':
362362
import nose # noqa
363-
nose.runmodule(argv=[__file__, '-vvs', '-x', '--pdb', '--pdb-failure'],
364-
exit=False)
363+
import pytest
364+
365+
pytest.main([__file__, '-vvs', '-x', '--pdb'])

pandas/sparse/tests/test_frame.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1066,6 +1066,6 @@ def test_numpy_func_call(self):
10661066
getattr(np, func)(self.frame)
10671067

10681068
if __name__ == '__main__':
1069-
import nose
1070-
nose.runmodule(argv=[__file__, '-vvs', '-x', '--pdb', '--pdb-failure'],
1071-
exit=False)
1069+
import pytest
1070+
1071+
pytest.main([__file__, '-vvs', '-x', '--pdb'])

pandas/sparse/tests/test_libsparse.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -589,5 +589,6 @@ def f(self):
589589

590590
if __name__ == '__main__':
591591
import nose # noqa
592-
nose.runmodule(argv=[__file__, '-vvs', '-x', '--pdb', '--pdb-failure'],
593-
exit=False)
592+
import pytest
593+
594+
pytest.main([__file__, '-vvs', '-x', '--pdb'])

pandas/sparse/tests/test_list.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,6 @@ def test_getitem(self):
115115

116116

117117
if __name__ == '__main__':
118-
import nose
119-
nose.runmodule(argv=[__file__, '-vvs', '-x', '--pdb', '--pdb-failure'],
120-
exit=False)
118+
import pytest
119+
120+
pytest.main([__file__, '-vvs', '-x', '--pdb'])

pandas/sparse/tests/test_series.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1365,6 +1365,6 @@ def test_numpy_func_call(self):
13651365

13661366

13671367
if __name__ == '__main__':
1368-
import nose
1369-
nose.runmodule(argv=[__file__, '-vvs', '-x', '--pdb', '--pdb-failure'],
1370-
exit=False)
1368+
import pytest
1369+
1370+
pytest.main([__file__, '-vvs', '-x', '--pdb'])

pandas/stats/tests/test_fama_macbeth.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,6 @@ def _check_stuff_works(self, result):
6868
result.summary
6969

7070
if __name__ == '__main__':
71-
import nose
72-
nose.runmodule(argv=[__file__, '-vvs', '-x', '--pdb', '--pdb-failure'],
73-
exit=False)
71+
import pytest
72+
73+
pytest.main([__file__, '-vvs', '-x', '--pdb'])

pandas/stats/tests/test_math.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -59,5 +59,6 @@ def test_inv_illformed(self):
5959
self.assertTrue(np.allclose(rs, expected))
6060

6161
if __name__ == '__main__':
62-
nose.runmodule(argv=[__file__, '-vvs', '-x', '--pdb', '--pdb-failure'],
63-
exit=False)
62+
import pytest
63+
64+
pytest.main([__file__, '-vvs', '-x', '--pdb'])

pandas/stats/tests/test_ols.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -977,6 +977,6 @@ def tsAssertEqual(self, ts1, ts2, **kwargs):
977977

978978

979979
if __name__ == '__main__':
980-
import nose
981-
nose.runmodule(argv=[__file__, '-vvs', '-x', '--pdb', '--pdb-failure'],
982-
exit=False)
980+
import pytest
981+
982+
pytest.main([__file__, '-vvs', '-x', '--pdb'])

pandas/tests/formats/test_format.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -4435,5 +4435,6 @@ def test_format_percentiles():
44354435

44364436

44374437
if __name__ == '__main__':
4438-
nose.runmodule(argv=[__file__, '-vvs', '-x', '--pdb', '--pdb-failure'],
4439-
exit=False)
4438+
import pytest
4439+
4440+
pytest.main([__file__, '-vvs', '-x', '--pdb'])

pandas/tests/formats/test_printing.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
# -*- coding: utf-8 -*-
2-
import nose
32
from pandas import compat
43
import pandas.formats.printing as printing
54
import pandas.formats.format as fmt
@@ -138,5 +137,6 @@ def test_ambiguous_width(self):
138137

139138

140139
if __name__ == '__main__':
141-
nose.runmodule(argv=[__file__, '-vvs', '-x', '--pdb', '--pdb-failure'],
142-
exit=False)
140+
import pytest
141+
142+
pytest.main([__file__, '-vvs', '-x', '--pdb'])

pandas/tests/frame/test_analytics.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -2158,5 +2158,6 @@ def test_dot(self):
21582158
df.dot(df2)
21592159

21602160
if __name__ == '__main__':
2161-
nose.runmodule(argv=[__file__, '-vvs', '-x', '--pdb', '--pdb-failure'],
2162-
exit=False)
2161+
import pytest
2162+
2163+
pytest.main([__file__, '-vvs', '-x', '--pdb'])

pandas/tests/frame/test_asof.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
# coding=utf-8
22

3-
import nose
4-
53
import numpy as np
64
from pandas import DataFrame, date_range
75

@@ -68,5 +66,6 @@ def test_subset(self):
6866
assert_frame_equal(result, expected)
6967

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

pandas/tests/frame/test_constructors.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -1922,5 +1922,6 @@ def test_from_index(self):
19221922
if __name__ == '__main__':
19231923
import nose # noqa
19241924

1925-
nose.runmodule(argv=[__file__, '-vvs', '-x', '--pdb', '--pdb-failure'],
1926-
exit=False)
1925+
import pytest
1926+
1927+
pytest.main([__file__, '-vvs', '-x', '--pdb'])

0 commit comments

Comments
 (0)