Skip to content

Commit

Permalink
Remove pin of pytest library
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
enrico-usai committed Aug 7, 2023
1 parent 1d5c718 commit bdcf083
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion tests/integration-tests/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ matplotlib
pexpect
pykwalify
pyOpenSSL
pytest~=7.3.2
pytest
pytest-datadir
pytest-html
pytest-rerunfailures
Expand Down
3 changes: 3 additions & 0 deletions tests/integration-tests/tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,6 @@ skip_install = true
deps = -r requirements.txt
commands =
python -m framework.tests_configuration.config_generator --output-file {posargs} --tests-root-dir tests/

[pytest]
# No options, section required to define pytest root dir.

0 comments on commit bdcf083

Please sign in to comment.