Skip to content

Commit e1b34a9

Browse files
author
Francesc Alted
committed
Force a reload of pd.computation for actually triggering the UserWarning
1 parent c081199 commit e1b34a9

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

pandas/tests/computation/test_compat.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,11 @@
1111
from pandas.computation.engines import _engines
1212
import pandas.computation.expr as expr
1313
from pandas.computation import _MIN_NUMEXPR_VERSION
14-
14+
# Get reload for Python 3.4 and on, if not, use internal reload()
15+
try:
16+
from importlib import reload
17+
except ImportError:
18+
pass
1519

1620
ENGINES_PARSERS = list(product(_engines, expr._parsers))
1721

@@ -26,7 +30,8 @@ def test_compat():
2630
if ver < LooseVersion(_MIN_NUMEXPR_VERSION):
2731
with tm.assert_produces_warning(UserWarning,
2832
check_stacklevel=False):
29-
assert not _NUMEXPR_INSTALLED
33+
reload(pd.computation)
34+
assert not _NUMEXPR_INSTALLED
3035
else:
3136
assert _NUMEXPR_INSTALLED
3237

0 commit comments

Comments
 (0)