Skip to content

Commit ddb22f5

Browse files
QuLogicjreback
authored andcommitted
TST: Parametrize simple yield tests
xref #15341 Author: Elliott Sales de Andrade <[email protected]> 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.
1 parent f2246cf commit ddb22f5

File tree

5 files changed

+92
-199
lines changed

5 files changed

+92
-199
lines changed

ci/script_multi.sh

+6
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ if [ -n "$LOCALE_OVERRIDE" ]; then
1717
python -c "$pycmd"
1818
fi
1919

20+
# Workaround for pytest-xdist flaky collection order
21+
# https://github.com/pytest-dev/pytest/issues/920
22+
# https://github.com/pytest-dev/pytest/issues/1075
23+
export PYTHONHASHSEED=$(python -c 'import random; print(random.randint(1, 4294967295))')
24+
echo PYTHONHASHSEED=$PYTHONHASHSEED
25+
2026
if [ "$BUILD_TEST" ]; then
2127
echo "We are not running pytest as this is simply a build test."
2228
elif [ "$COVERAGE" ]; then

pandas/tests/computation/test_compat.py

+3-8
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
import pandas.computation.expr as expr
1313
from pandas.computation import _MIN_NUMEXPR_VERSION
1414

15-
ENGINES_PARSERS = list(product(_engines, expr._parsers))
16-
1715

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

3230

33-
def test_invalid_numexpr_version():
34-
for engine, parser in ENGINES_PARSERS:
35-
yield check_invalid_numexpr_version, engine, parser
36-
37-
38-
def check_invalid_numexpr_version(engine, parser):
31+
@pytest.mark.parametrize('engine', _engines)
32+
@pytest.mark.parametrize('parser', expr._parsers)
33+
def test_invalid_numexpr_version(engine, parser):
3934
def testit():
4035
a, b = 1, 2
4136
res = pd.eval('a + b', engine=engine, parser=parser)

0 commit comments

Comments
 (0)