Skip to content
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

Fix test integration with IDEs #1914

Merged
merged 1 commit into from
Feb 17, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
14 changes: 7 additions & 7 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# spell-checker:ignore filterwarnings norecursedirs optionflags
[pytest]
# do not add options here as this will likely break either console runs or IDE
# integration like 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`. 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