Skip to content

Commit

Permalink
TST: Parametrize simple yield tests
Browse files Browse the repository at this point in the history
xref #15341

Author: Elliott Sales de Andrade <quantum.analyst@gmail.com>

Closes #15406 from QuLogic/pytest-simple-yield and squashes the following commits:

b002752 [Elliott Sales de Andrade] TST: Set PYTHONHASHSEED so xdist doesn't break.
8368772 [Elliott Sales de Andrade] TST: Use fixtures for engine/parser where possible.
c6cd346 [Elliott Sales de Andrade] TST: Parametrize remaining simple yield tests.
47bf1a1 [Elliott Sales de Andrade] TST: Replace ENGINES_PARSERS by parametrize.
  • Loading branch information
QuLogic authored and jreback committed Feb 16, 2017
1 parent f2246cf commit ddb22f5
Show file tree
Hide file tree
Showing 5 changed files with 92 additions and 199 deletions.
6 changes: 6 additions & 0 deletions ci/script_multi.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ if [ -n "$LOCALE_OVERRIDE" ]; then
python -c "$pycmd"
fi

# Workaround for pytest-xdist flaky collection order
# https://github.com/pytest-dev/pytest/issues/920
# https://github.com/pytest-dev/pytest/issues/1075
export PYTHONHASHSEED=$(python -c 'import random; print(random.randint(1, 4294967295))')
echo PYTHONHASHSEED=$PYTHONHASHSEED

if [ "$BUILD_TEST" ]; then
echo "We are not running pytest as this is simply a build test."
elif [ "$COVERAGE" ]; then
Expand Down
11 changes: 3 additions & 8 deletions pandas/tests/computation/test_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
import pandas.computation.expr as expr
from pandas.computation import _MIN_NUMEXPR_VERSION

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


def test_compat():
# test we have compat with our version of nu
Expand All @@ -30,12 +28,9 @@ def test_compat():
pytest.skip("not testing numexpr version compat")


def test_invalid_numexpr_version():
for engine, parser in ENGINES_PARSERS:
yield check_invalid_numexpr_version, engine, parser


def check_invalid_numexpr_version(engine, parser):
@pytest.mark.parametrize('engine', _engines)
@pytest.mark.parametrize('parser', expr._parsers)
def test_invalid_numexpr_version(engine, parser):
def testit():
a, b = 1, 2
res = pd.eval('a + b', engine=engine, parser=parser)
Expand Down
Loading

0 comments on commit ddb22f5

Please sign in to comment.