Skip to content

Commit 8d57450

Browse files
authored
TST: remove __main__ from all test files (#15330)
1 parent 6d2293f commit 8d57450

File tree

112 files changed

+21
-703
lines changed

Some content is hidden

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

112 files changed

+21
-703
lines changed

pandas/api/tests/test_api.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -227,8 +227,3 @@ def test_deprecation_access_obj(self):
227227
with tm.assert_produces_warning(FutureWarning,
228228
check_stacklevel=False):
229229
pd.datetools.monthEnd
230-
231-
if __name__ == '__main__':
232-
import nose
233-
nose.runmodule(argv=[__file__, '-vvs', '-x', '--pdb', '--pdb-failure'],
234-
exit=False)

pandas/computation/tests/test_compat.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,3 @@ def testit():
6161
testit()
6262
else:
6363
testit()
64-
65-
66-
if __name__ == '__main__':
67-
nose.runmodule(argv=[__file__, '-vvs', '-x', '--pdb', '--pdb-failure'],
68-
exit=False)

pandas/computation/tests/test_eval.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1977,8 +1977,3 @@ def test_validate_bool_args(self):
19771977
for value in invalid_values:
19781978
with self.assertRaises(ValueError):
19791979
pd.eval("2+2", inplace=value)
1980-
1981-
1982-
if __name__ == '__main__':
1983-
nose.runmodule(argv=[__file__, '-vvs', '-x', '--pdb', '--pdb-failure'],
1984-
exit=False)

pandas/core/frame.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5762,8 +5762,3 @@ def boxplot(self, column=None, by=None, ax=None, fontsize=None, rot=0,
57625762

57635763
ops.add_flex_arithmetic_methods(DataFrame, **ops.frame_flex_funcs)
57645764
ops.add_special_arithmetic_methods(DataFrame, **ops.frame_special_funcs)
5765-
5766-
if __name__ == '__main__':
5767-
import nose
5768-
nose.runmodule(argv=[__file__, '-vvs', '-x', '--pdb', '--pdb-failure'],
5769-
exit=False)

pandas/formats/format.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2679,17 +2679,3 @@ def _binify(cols, line_width):
26792679

26802680
bins.append(len(cols))
26812681
return bins
2682-
2683-
2684-
if __name__ == '__main__':
2685-
arr = np.array([746.03, 0.00, 5620.00, 1592.36])
2686-
# arr = np.array([11111111.1, 1.55])
2687-
# arr = [314200.0034, 1.4125678]
2688-
arr = np.array(
2689-
[327763.3119, 345040.9076, 364460.9915, 398226.8688, 383800.5172,
2690-
433442.9262, 539415.0568, 568590.4108, 599502.4276, 620921.8593,
2691-
620898.5294, 552427.1093, 555221.2193, 519639.7059, 388175.7,
2692-
379199.5854, 614898.25, 504833.3333, 560600., 941214.2857, 1134250.,
2693-
1219550., 855736.85, 1042615.4286, 722621.3043, 698167.1818, 803750.])
2694-
fmt = FloatArrayFormatter(arr, digits=7)
2695-
print(fmt.get_result())

pandas/io/tests/json/test_normalize.py

Lines changed: 0 additions & 7 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
@@ -283,8 +281,3 @@ def test_json_normalize_errors(self):
283281
['general', 'trade_version']],
284282
errors='raise'
285283
)
286-
287-
288-
if __name__ == '__main__':
289-
nose.runmodule(argv=[__file__, '-vvs', '-x', '--pdb',
290-
'--pdb-failure', '-s'], exit=False)

pandas/io/tests/json/test_pandas.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1044,8 +1044,3 @@ def roundtrip(s, encoding='latin-1'):
10441044

10451045
for s in examples:
10461046
roundtrip(s)
1047-
1048-
1049-
if __name__ == '__main__':
1050-
nose.runmodule(argv=[__file__, '-vvs', '-x', '--pdb',
1051-
'--pdb-failure', '-s'], exit=False)

pandas/io/tests/json/test_ujson.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1611,8 +1611,3 @@ def test_encodeSet(self):
16111611

16121612
def _clean_dict(d):
16131613
return dict((str(k), v) for k, v in compat.iteritems(d))
1614-
1615-
1616-
if __name__ == '__main__':
1617-
nose.runmodule(argv=[__file__, '-vvs', '-x', '--pdb', '--pdb-failure'],
1618-
exit=False)

pandas/io/tests/parser/test_network.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,3 @@ def test_s3_fails(self):
182182
# It's irrelevant here that this isn't actually a table.
183183
with tm.assertRaises(IOError):
184184
read_csv('s3://cant_get_it/')
185-
186-
if __name__ == '__main__':
187-
nose.runmodule(argv=[__file__, '-vvs', '-x', '--pdb', '--pdb-failure'],
188-
exit=False)

pandas/io/tests/parser/test_parsers.py

Lines changed: 0 additions & 5 deletions
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

@@ -99,7 +98,3 @@ def read_table(self, *args, **kwds):
9998
kwds = kwds.copy()
10099
kwds['engine'] = self.engine
101100
return read_table(*args, **kwds)
102-
103-
if __name__ == '__main__':
104-
nose.runmodule(argv=[__file__, '-vvs', '-x', '--pdb', '--pdb-failure'],
105-
exit=False)

0 commit comments

Comments
 (0)