-
Notifications
You must be signed in to change notification settings - Fork 386
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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.
- Loading branch information
1 parent
c7e6321
commit 03b0d19
Showing
4 changed files
with
55 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters