Skip to content

Commit

Permalink
Fix test debugging from cli or IDEs
Browse files Browse the repository at this point in the history
  • Loading branch information
ssbarnea committed Feb 17, 2022
1 parent 5bd1468 commit c877135
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .config/dictionary.txt
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ prerun
psutil
pyargs
pycache
pycharm
pyenv
pygments
pylint
Expand Down Expand Up @@ -187,6 +188,7 @@ xdist
xfail
xunit
zuul

# Contributors
Sorin
Sbarnea
Expand Down
15 changes: 8 additions & 7 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
# spell-checker:ignore filterwarnings norecursedirs optionflags
[pytest]
# do not add options here as this will likely break
# either console runs or IDE integration with vscode or # pycharm
addopts =
-ra
--showlocals
--doctest-modules
# interpret all the target args as things that can be imported:
--pyargs
# https://code.visualstudio.com/docs/python/testing
# coverage is re-enabled in tox.ini, without this
# debugger integration would not work. That approach is safer
# than `--no-cov` which prevents activation from tox.ini and
# which also fails when plugin is effectively missing.
-p no:pytest_cov

# pytest will collect most tests from either `tests` or `ansiblelint.rules`.
# It also collects doctest from other modules.
doctest_optionflags = ALLOW_UNICODE ELLIPSIS
filterwarnings =
error
Expand Down
3 changes: 3 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ commands =
# pytest users to run coverage when they just want to run a single test with `pytest -k test`
{envpython} -m pytest {posargs:\
-n auto \
-ra \
--showlocals \
--doctest-modules \
--no-success-flaky-report \
--durations=10 \
-m "not eco" \
Expand Down

0 comments on commit c877135

Please sign in to comment.