Skip to content

Commit f00158a

Browse files
committed
TST: Fix bz2 non-import test
1 parent 3ac3ced commit f00158a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pandas/tests/test_common.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -250,10 +250,10 @@ def test_str_size():
250250
def test_bz2_missing_import():
251251
# Check whether bz2 missing import is handled correctly (issue #53857)
252252
code = (
253-
"import pytest\n"
254-
"sys.modules.pop('bz2', None)\n"
255-
"import pandas\n"
256-
"assert 'bz2' not in sys.modules\n"
253+
"import sys\n"
254+
"assert 'bz2' in sys.modules\n"
255+
"sys.modules['bz2'] = None\n"
256+
"import pandas as pd\n"
257257
"from pandas.compat import get_bz2_file\n"
258258
"msg = 'bz2 module not available.'\n"
259259
"with pytest.raises(RuntimeError, match=msg):\n"

0 commit comments

Comments
 (0)