Skip to content

Commit d991d4c

Browse files
committed
simplify construction
1 parent fa6c433 commit d991d4c

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

pandas/tests/test_common.py

+8-9
Original file line numberDiff line numberDiff line change
@@ -226,20 +226,19 @@ def test_standardize_mapping():
226226
assert isinstance(com.standardize_mapping(dd), partial)
227227

228228

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)])
229+
@pytest.mark.parametrize('obj', [
230+
DataFrame(100 * [[0.123456, 0.234567, 0.567567],
231+
[12.32112, 123123.2, 321321.2]],
232+
columns=['X', 'Y', 'Z']),
233+
Series(100 * [0.123456, 0.234567, 0.567567], name='X')])
235234
@pytest.mark.parametrize('method', ['to_pickle', 'to_json', 'to_csv'])
236-
def test_compression_size(frame, method, compression):
235+
def test_compression_size(obj, method, compression):
237236
if not compression:
238237
pytest.skip("only test compression case.")
239238

240239
with tm.ensure_clean() as filename:
241-
getattr(frame, method)(filename, compression=compression)
240+
getattr(obj, method)(filename, compression=compression)
242241
compressed = os.path.getsize(filename)
243-
getattr(frame, method)(filename, compression=None)
242+
getattr(obj, method)(filename, compression=None)
244243
uncompressed = os.path.getsize(filename)
245244
assert uncompressed > compressed

0 commit comments

Comments
 (0)