New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pytest 7.4.0 release broke addoption behaviour #11134
Comments
Hi @enrico-usai, How do you invoke pytest? |
Sorry, I see that you linked to it. I'll try and have a look. |
If I am reading correctly (from a quick skim in github), it looks like you are running with |
Thank you @bluetech for your analysis! I'll try to fix this. |
FWIW, in our case this was solved by adding an empty As far as I can tell, in your case adding This is the relevant part of the docs: https://docs.pytest.org/en/stable/reference/customize.html#finding-the-rootdir
|
This issue is stale because it has been open for 14 days with no activity. |
This issue was closed because it has been inactive for 7 days since being marked as stale. |
We pinned pytest because usage of custom args stopped to work with pytest 3.7.4. At the end it was a configuration issue: we were missing to specify which is the pytest root dir. Adding a `[pytest]` section in the `tox.ini` file permits pytest to discover the right root dir and so to use custom arguments. ### Tests Without the pin and before this patch tests were failing with: ``` ERROR: usage: test_runner.py [options] [file_or_dir] [file_or_dir] [...] test_runner.py: error: unrecognized arguments: --tests-log-file=/tmp//...eu-west-1.log --output-dir=/tmp/...eu-west-1 --key-name=... --key-path=...usai-common.pem --stackname-suffix --tests-config-file=/tmp/...tests_config.yaml --regions eu-west-1 --ami-owner ... --vpc-stack integ-tests-vpc-...-360 --no-delete ... inifile: None rootdir: .../aws-parallelcluster/tests/integration-tests/tests ``` Now tests are executed correctly. ### References * pytest-dev/pytest#11134 * https://docs.pytest.org/en/stable/reference/customize.html#finding-the-rootdir Signed-off-by: Enrico Usai <usai@amazon.com>
We pinned pytest because usage of custom args stopped to work with pytest 3.7.4. At the end it was a configuration issue: we were missing to specify which is the pytest root dir. Adding a `[pytest]` section in the `tox.ini` file permits pytest to discover the right root dir and so to use custom arguments. ### Tests Without the pin and before this patch tests were failing with: ``` ERROR: usage: test_runner.py [options] [file_or_dir] [file_or_dir] [...] test_runner.py: error: unrecognized arguments: --tests-log-file=/tmp//...eu-west-1.log --output-dir=/tmp/...eu-west-1 --key-name=... --key-path=...usai-common.pem --stackname-suffix --tests-config-file=/tmp/...tests_config.yaml --regions eu-west-1 --ami-owner ... --vpc-stack integ-tests-vpc-...-360 --no-delete ... inifile: None rootdir: .../aws-parallelcluster/tests/integration-tests/tests ``` Now tests are executed correctly. ### References * pytest-dev/pytest#11134 * https://docs.pytest.org/en/stable/reference/customize.html#finding-the-rootdir Signed-off-by: Enrico Usai <usai@amazon.com>
@greschd I can confirm that adding the |
We pinned pytest because usage of custom args stopped to work with pytest 3.7.4. At the end it was a configuration issue: we were missing to specify which is the pytest root dir. Adding a `[pytest]` section in the `tox.ini` file permits pytest to discover the right root dir and so to use custom arguments. ### Tests Without the pin and before this patch tests were failing with: ``` ERROR: usage: test_runner.py [options] [file_or_dir] [file_or_dir] [...] test_runner.py: error: unrecognized arguments: --tests-log-file=/tmp//...eu-west-1.log --output-dir=/tmp/...eu-west-1 --key-name=... --key-path=...usai-common.pem --stackname-suffix --tests-config-file=/tmp/...tests_config.yaml --regions eu-west-1 --ami-owner ... --vpc-stack integ-tests-vpc-...-360 --no-delete ... inifile: None rootdir: .../aws-parallelcluster/tests/integration-tests/tests ``` Now tests are executed correctly. ### References * pytest-dev/pytest#11134 * https://docs.pytest.org/en/stable/reference/customize.html#finding-the-rootdir Signed-off-by: Enrico Usai <usai@amazon.com>
We pinned pytest because usage of custom args stopped to work with pytest 3.7.4. At the end it was a configuration issue: we were missing to specify which is the pytest root dir. Adding a `[pytest]` section in the `tox.ini` file permits pytest to discover the right root dir and so to use custom arguments. ### Tests Without the pin and before this patch tests were failing with: ``` ERROR: usage: test_runner.py [options] [file_or_dir] [file_or_dir] [...] test_runner.py: error: unrecognized arguments: --tests-log-file=/tmp//...eu-west-1.log --output-dir=/tmp/...eu-west-1 --key-name=... --key-path=...usai-common.pem --stackname-suffix --tests-config-file=/tmp/...tests_config.yaml --regions eu-west-1 --ami-owner ... --vpc-stack integ-tests-vpc-...-360 --no-delete ... inifile: None rootdir: .../aws-parallelcluster/tests/integration-tests/tests ``` Now tests are executed correctly. ### References * pytest-dev/pytest#11134 * https://docs.pytest.org/en/stable/reference/customize.html#finding-the-rootdir Signed-off-by: Enrico Usai <usai@amazon.com>
Hi!
In the AWS ParallelCluster project we are using pytest and adding some custom options to it:
Our tests started to fail after the automatic upgrade to 7.4.0 with an error like:
So we had to pin the version to 7.3.2: aws/aws-parallelcluster#5425
Pip freeze
The text was updated successfully, but these errors were encountered: