Skip to content

Commit

Permalink
Force a reload of pd.computation for actually triggering the UserWarning
Browse files Browse the repository at this point in the history
  • Loading branch information
Francesc Alted committed Feb 15, 2017
1 parent c081199 commit e1b34a9
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions pandas/tests/computation/test_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@
from pandas.computation.engines import _engines
import pandas.computation.expr as expr
from pandas.computation import _MIN_NUMEXPR_VERSION

# Get reload for Python 3.4 and on, if not, use internal reload()
try:
from importlib import reload
except ImportError:
pass

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

Expand All @@ -26,7 +30,8 @@ def test_compat():
if ver < LooseVersion(_MIN_NUMEXPR_VERSION):
with tm.assert_produces_warning(UserWarning,
check_stacklevel=False):
assert not _NUMEXPR_INSTALLED
reload(pd.computation)
assert not _NUMEXPR_INSTALLED
else:
assert _NUMEXPR_INSTALLED

Expand Down

0 comments on commit e1b34a9

Please sign in to comment.