Skip to content

Commit cccc82c

Browse files
committed
TST: Change nose.runmodule to pytest
1 parent 5eeffcb commit cccc82c

File tree

99 files changed

+293
-226
lines changed

Some content is hidden

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

99 files changed

+293
-226
lines changed

pandas/api/tests/test_api.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,6 @@ def test_deprecation_access_obj(self):
222222
pd.datetools.monthEnd
223223

224224
if __name__ == '__main__':
225-
import nose
226-
nose.runmodule(argv=[__file__, '-vvs', '-x', '--pdb', '--pdb-failure'],
227-
exit=False)
225+
import pytest
226+
227+
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-2
Original file line numberDiff line numberDiff line change
@@ -226,5 +226,6 @@ def test_nested_flattens(self):
226226
self.assertEqual(result, expected)
227227

228228
if __name__ == '__main__':
229-
nose.runmodule(argv=[__file__, '-vvs', '-x', '--pdb',
230-
'--pdb-failure', '-s'], exit=False)
229+
import pytest
230+
231+
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-2
Original file line numberDiff line numberDiff line change
@@ -98,5 +98,6 @@ def read_table(self, *args, **kwds):
9898
return read_table(*args, **kwds)
9999

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

pandas/io/tests/parser/test_textreader.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -398,5 +398,6 @@ def assert_array_dicts_equal(left, right):
398398
assert(np.array_equal(v, right[k]))
399399

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

pandas/io/tests/parser/test_unsupported.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -150,5 +150,6 @@ def test_deprecated_args(self):
150150
**kwargs)
151151

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

pandas/io/tests/test_date_converters.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -139,5 +139,6 @@ def date_parser(date, time):
139139
assert_frame_equal(df, df_correct)
140140

141141
if __name__ == '__main__':
142-
nose.runmodule(argv=[__file__, '-vvs', '-x', '--pdb', '--pdb-failure'],
143-
exit=False)
142+
import pytest
143+
144+
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-2
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,6 @@ def test_is_s3_url(self):
1010
self.assertFalse(_is_s3_url("s4://pandas/somethingelse.com"))
1111

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

pandas/io/tests/test_sql.py

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

26592659

26602660
if __name__ == '__main__':
2661-
nose.runmodule(argv=[__file__, '-vvs', '-x', '--pdb', '--pdb-failure'],
2662-
exit=False)
2661+
import pytest
2662+
2663+
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-2
Original file line numberDiff line numberDiff line change
@@ -138,5 +138,6 @@ def test_ambiguous_width(self):
138138

139139

140140
if __name__ == '__main__':
141-
nose.runmodule(argv=[__file__, '-vvs', '-x', '--pdb', '--pdb-failure'],
142-
exit=False)
141+
import pytest
142+
143+
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-2
Original file line numberDiff line numberDiff line change
@@ -68,5 +68,6 @@ def test_subset(self):
6868
assert_frame_equal(result, expected)
6969

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

pandas/tests/frame/test_constructors.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -1914,5 +1914,6 @@ def test_from_index(self):
19141914
if __name__ == '__main__':
19151915
import nose # noqa
19161916

1917-
nose.runmodule(argv=[__file__, '-vvs', '-x', '--pdb', '--pdb-failure'],
1918-
exit=False)
1917+
import pytest
1918+
1919+
pytest.main([__file__, '-vvs', '-x', '--pdb'])

pandas/tests/frame/test_misc_api.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -484,5 +484,6 @@ def _check_f(base, f):
484484

485485

486486
if __name__ == '__main__':
487-
nose.runmodule(argv=[__file__, '-vvs', '-x', '--pdb', '--pdb-failure'],
488-
exit=False)
487+
import pytest
488+
489+
pytest.main([__file__, '-vvs', '-x', '--pdb'])

pandas/tests/frame/test_missing.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,6 @@ def test_interp_ignore_all_good(self):
660660

661661

662662
if __name__ == '__main__':
663-
import nose
664-
nose.runmodule(argv=[__file__, '-vvs', '-x', '--pdb', '--pdb-failure'],
665-
# '--with-coverage', '--cover-package=pandas.core']
666-
exit=False)
663+
import pytest
664+
665+
pytest.main([__file__, '-vvs', '-x', '--pdb'])

pandas/tests/frame/test_operators.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -1261,5 +1261,6 @@ def test_alignment_non_pandas(self):
12611261

12621262

12631263
if __name__ == '__main__':
1264-
nose.runmodule(argv=[__file__, '-vvs', '-x', '--pdb', '--pdb-failure'],
1265-
exit=False)
1264+
import pytest
1265+
1266+
pytest.main([__file__, '-vvs', '-x', '--pdb'])

pandas/tests/frame/test_query_eval.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -1158,5 +1158,6 @@ def setUpClass(cls):
11581158

11591159

11601160
if __name__ == '__main__':
1161-
nose.runmodule(argv=[__file__, '-vvs', '-x', '--pdb', '--pdb-failure'],
1162-
exit=False)
1161+
import pytest
1162+
1163+
pytest.main([__file__, '-vvs', '-x', '--pdb'])

pandas/tests/indexing/test_callable.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -271,5 +271,6 @@ def test_frame_iloc_callable_setitem(self):
271271

272272

273273
if __name__ == '__main__':
274-
nose.runmodule(argv=[__file__, '-vvs', '-x', '--pdb', '--pdb-failure'],
275-
exit=False)
274+
import pytest
275+
276+
pytest.main([__file__, '-vvs', '-x', '--pdb'])

pandas/tests/indexing/test_indexing.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -5407,5 +5407,6 @@ def test_none_coercion_mixed_dtypes(self):
54075407

54085408

54095409
if __name__ == '__main__':
5410-
nose.runmodule(argv=[__file__, '-vvs', '-x', '--pdb', '--pdb-failure'],
5411-
exit=False)
5410+
import pytest
5411+
5412+
pytest.main([__file__, '-vvs', '-x', '--pdb'])

pandas/tests/plotting/test_boxplot_method.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -372,5 +372,6 @@ def test_grouped_box_multiple_axes(self):
372372

373373

374374
if __name__ == '__main__':
375-
nose.runmodule(argv=[__file__, '-vvs', '-x', '--pdb', '--pdb-failure'],
376-
exit=False)
375+
import pytest
376+
377+
pytest.main([__file__, '-vvs', '-x', '--pdb'])

0 commit comments

Comments
 (0)