We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 957d043 commit 1ab1045Copy full SHA for 1ab1045
pandas/tests/test_common.py
@@ -7,6 +7,9 @@
7
import numpy as np
8
import pytest
9
10
+sys.modules.pop("bz2", None) # Remove 'bz2' from available modules for testing
11
+from pandas.compat import get_bz2_file
12
+
13
import pandas as pd
14
from pandas import Series
15
import pandas._testing as tm
@@ -15,6 +18,13 @@
18
from pandas.util.version import Version
16
19
17
20
21
+def test_bz2_nonimport():
22
+ assert "bz2" not in sys.modules
23
+ msg = "bz2 module not available."
24
+ with pytest.raises(RuntimeError, match=msg):
25
+ get_bz2_file()
26
27
28
def test_get_callable_name():
29
getname = com.get_callable_name
30
0 commit comments