Skip to content

Commit

Permalink
Change asyncio mode to auto.
Browse files Browse the repository at this point in the history
func tests for juju 2.9/focal were failing. This was because the asyncio
marker was not added to the tests.

This change adds the markers automatically to all the tests by passing
a CLI argument.

Refer:
https://pytest-asyncio.readthedocs.io/en/latest/concepts.html#test-discovery-modes
https://pytest-asyncio.readthedocs.io/en/latest/reference/configuration.html
  • Loading branch information
dashmage committed Dec 4, 2023
1 parent 6e515e4 commit 48f5943
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,12 @@ deps =
pytest-cov

[testenv:func]
commands = pytest {toxinidir}/tests/functional {posargs:-v}
commands = pytest {toxinidir}/tests/functional --asyncio-mode=auto {posargs:-v}
deps =
-r {toxinidir}/tests/functional/requirements.txt
juju < 3

[testenv:func31]
commands = pytest {toxinidir}/tests/functional {posargs:-v}
commands = pytest {toxinidir}/tests/functional --asyncio-mode=auto {posargs:-v}
deps =
-r {toxinidir}/tests/functional/requirements.txt

0 comments on commit 48f5943

Please sign in to comment.