Skip to content

Commit b268d89

Browse files
committed
TST: Change method to make reporting more standard
Replaced a __init__ method with a setUp method; Makes the XML generated by nose more standard. TST: Move staticmethod to top-level Makes the XML generated by nose more standard.
1 parent a638390 commit b268d89

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

pandas/io/tests/parser/test_network.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class TestCompressedUrl(object):
2424
'xz': '.xz',
2525
}
2626

27-
def __init__(self):
27+
def setUp(self):
2828
path = os.path.join(tm.get_data_path(), 'salaries.csv')
2929
self.local_table = read_table(path)
3030
self.base_url = ('https://github.com/pandas-dev/pandas/raw/master/'

pandas/tests/formats/test_format.py

+11-11
Original file line numberDiff line numberDiff line change
@@ -3923,6 +3923,15 @@ def test_period(self):
39233923
self.assertEqual(str(df), exp)
39243924

39253925

3926+
def gen_series_formatting():
3927+
s1 = pd.Series(['a'] * 100)
3928+
s2 = pd.Series(['ab'] * 100)
3929+
s3 = pd.Series(['a', 'ab', 'abc', 'abcd', 'abcde', 'abcdef'])
3930+
s4 = s3[::-1]
3931+
test_sers = {'onel': s1, 'twol': s2, 'asc': s3, 'desc': s4}
3932+
return test_sers
3933+
3934+
39263935
class TestSeriesFormatting(tm.TestCase):
39273936

39283937
def setUp(self):
@@ -4320,15 +4329,6 @@ def test_consistent_format(self):
43204329
'1.0000\n129 1.0000\ndtype: float64')
43214330
self.assertEqual(res, exp)
43224331

4323-
@staticmethod
4324-
def gen_test_series():
4325-
s1 = pd.Series(['a'] * 100)
4326-
s2 = pd.Series(['ab'] * 100)
4327-
s3 = pd.Series(['a', 'ab', 'abc', 'abcd', 'abcde', 'abcdef'])
4328-
s4 = s3[::-1]
4329-
test_sers = {'onel': s1, 'twol': s2, 'asc': s3, 'desc': s4}
4330-
return test_sers
4331-
43324332
def chck_ncols(self, s):
43334333
with option_context("display.max_rows", 10):
43344334
res = repr(s)
@@ -4339,7 +4339,7 @@ def chck_ncols(self, s):
43394339
self.assertEqual(ncolsizes, 1)
43404340

43414341
def test_format_explicit(self):
4342-
test_sers = self.gen_test_series()
4342+
test_sers = gen_series_formatting()
43434343
with option_context("display.max_rows", 4):
43444344
res = repr(test_sers['onel'])
43454345
exp = '0 a\n1 a\n ..\n98 a\n99 a\ndtype: object'
@@ -4358,7 +4358,7 @@ def test_format_explicit(self):
43584358
self.assertEqual(exp, res)
43594359

43604360
def test_ncols(self):
4361-
test_sers = self.gen_test_series()
4361+
test_sers = gen_series_formatting()
43624362
for s in test_sers.values():
43634363
self.chck_ncols(s)
43644364

0 commit comments

Comments
 (0)