Skip to content

Commit adb6fd6

Browse files
committed
simplify construction
1 parent fa6c433 commit adb6fd6

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

pandas/tests/test_common.py

+8-10
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
import numpy as np
99

10-
import pandas as pd
1110
from pandas import Series, DataFrame, Timestamp
1211
from pandas.compat import range, lmap
1312
import pandas.core.common as com
@@ -226,20 +225,19 @@ def test_standardize_mapping():
226225
assert isinstance(com.standardize_mapping(dd), partial)
227226

228227

229-
@pytest.mark.parametrize('frame', [
230-
pd.concat(100 * [DataFrame([[0.123456, 0.234567, 0.567567],
231-
[12.32112, 123123.2, 321321.2]],
232-
columns=['X', 'Y', 'Z'])], ignore_index=True),
233-
pd.concat(100 * [Series([0.123456, 0.234567, 0.567567], name='X')],
234-
ignore_index=True)])
228+
@pytest.mark.parametrize('obj', [
229+
DataFrame(100 * [[0.123456, 0.234567, 0.567567],
230+
[12.32112, 123123.2, 321321.2]],
231+
columns=['X', 'Y', 'Z']),
232+
Series(100 * [0.123456, 0.234567, 0.567567], name='X')])
235233
@pytest.mark.parametrize('method', ['to_pickle', 'to_json', 'to_csv'])
236-
def test_compression_size(frame, method, compression):
234+
def test_compression_size(obj, method, compression):
237235
if not compression:
238236
pytest.skip("only test compression case.")
239237

240238
with tm.ensure_clean() as filename:
241-
getattr(frame, method)(filename, compression=compression)
239+
getattr(obj, method)(filename, compression=compression)
242240
compressed = os.path.getsize(filename)
243-
getattr(frame, method)(filename, compression=None)
241+
getattr(obj, method)(filename, compression=None)
244242
uncompressed = os.path.getsize(filename)
245243
assert uncompressed > compressed

0 commit comments

Comments
 (0)