You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
test(unit): add missing dependency on fixtures to help parallel testing
When running the test suite with xdist and 'pytest -n <jobs>', several
tests fail. This happens because, in these tests, the definition of the
tested command, usually in a fixture method called 'functions' might
happen only after the execution of the tests themselves, i.e. in the
methods whose names start with 'test_'.
This patch adds the missing dependency on these test-command-defining
fixtures, so that they are executed before the tests themselves.
Steps to reproduce:
1. Make sure pytest-xdist is installed. On Debian systems this can be
verified with the following command:
dpkg --list python3-pytest-xdist
2. Build and install bash-completion locally, for example with the
following commands:
autoreconf -f -i
./configure --prefix=$PWD/install/
make install
3. Run the test suite with a few parallel jobs, such as with:
export MYPATH=$PWD/install/share/bash-completion/bash_completion
BASH_COMPLETION_TEST_BASH_COMPLETION=$MYPATH \
pytest \
-n 8 \
test/t/unit/test_unit_count_args.py \
test/t/unit/test_unit_dequote.py \
test/t/unit/test_unit_get_first_arg.py \
test/t/unit/test_unit_quote.py
unset MYPATH
Before this patch, these tests fail with messages similar to:
FAILED test/t/unit/test_unit_quote.py::TestUnitQuote::test_3 -
AssertionError: Error running "__tester " a "": exit status=127, output="
After this patch, all these tests, which previously failed, pass.
0 commit comments