X Tutup
Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,10 @@ env:
- NPROC=2
- TEST_ARGS=--no-pep8
- NOSE_ARGS="-j $NPROC"
- PYTEST_ARGS="-ra --timeout=300 --durations=25 --cov-report= --cov=lib" # -n $NPROC
- PYTEST_ARGS="-ra --timeout=300 --durations=25 --cov-report= --cov=lib -n $NPROC"
- PYTHON_ARGS=
- DELETE_FONT_CACHE=
- USE_PYTEST=false
#- PYTHONHASHSEED=0 # Workaround for pytest-xdist flaky colletion order
# # https://github.com/pytest-dev/pytest/issues/920
# # https://github.com/pytest-dev/pytest/issues/1075

matrix:
include:
Expand Down Expand Up @@ -166,6 +163,12 @@ script:
gdb -return-child-result -batch -ex r -ex bt --args python $PYTHON_ARGS tests.py $NOSE_ARGS $TEST_ARGS
fi
else
# Workaround for pytest-xdist flaky colletion order
# https://github.com/pytest-dev/pytest/issues/920
# https://github.com/pytest-dev/pytest/issues/1075
export PYTHONHASHSEED=$(shuf -i 1-4294967295 -n 1)
echo PYTHONHASHSEED=$PYTHONHASHSEED
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this affect the determinism tests?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aren't the tests that really care about this run in a shell-call with their own seeds set?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see it set/unset PYTHONHASHSEED, so wouldn't it be inherited?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I think you are right 🐑

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, I have find out that xdist collection problem is triggered by test_mathtext.py, but I do not know what exactly, maybe globals() injection magic or something else. I think the best option for us is to rewrite test_mathtext to pytest fixtures and forget about this xdist issue.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, that definitely is weird; is there a way to parametrize the fileename passed to the image_comparison decorator?


echo The following args are passed to pytest $PYTEST_ARGS
py.test $PYTEST_ARGS $TEST_ARGS
fi
Expand Down
X Tutup