Skip to content

Commit 2f6601d

Browse files
committed
TST + DOC: test_compression_warning docstring
1 parent c098c8f commit 2f6601d

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

pandas/tests/test_common.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,8 +251,18 @@ def test_compression_size_fh(obj, method, compression_only):
251251
assert uncompressed > compressed
252252

253253

254-
# GH 21227
255254
def test_compression_warning(compression_only):
255+
"""
256+
Assert that passing a file object to to_csv while explicitly specifying a
257+
compression protocol triggers a RuntimeWarning, as per
258+
https://github.com/pandas-dev/pandas/issues/21227.
259+
260+
Note that pytest has an issue that causes assert_produces_warning to fail
261+
in Python 2 if the warning has occurred in previous tests
262+
(see https://git.io/fNEBm & https://git.io/fNEBC). Hence, should this test
263+
fail in just Python 2 builds, it likely indicates that other tests are
264+
producing RuntimeWarnings, thereby triggering the pytest bug.
265+
"""
256266
df = DataFrame(100 * [[0.123456, 0.234567, 0.567567],
257267
[12.32112, 123123.2, 321321.2]],
258268
columns=['X', 'Y', 'Z'])

0 commit comments

Comments
 (0)