You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Pytest Tooling] Eliminate spurious Pytest warnings about unregistered marks #2745
When running the test suites for a Python exercise in a local environment, Pytest generates a set of warnings because each of the tests is annotated (decorated) with @pytest.mark.task. Because task isn't registered, the Pytest output includes lines such as
dicts_test.py:50
/Users/xyz/Exercism/python/inventory-management/dicts_test.py:50: PytestUnknownMarkWarning: Unknown pytest.mark.task - is this a typo? You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/mark.html
@pytest.mark.task(taskno=4)
This output is noisy and of little value to the developer.
Would it be reasonable to add a pytest.ini or pyproject.toml file as described in the link above to each of the exercises?
Thanks for logging this issue. The warnings should vanish if you place the ini file in the root of the exercise folder (e.g. under python/. You shouldn't need a copy in the individual exercise folders. We're investigating why it isn't currently downloading with the exercises.
Additionally, you can run pytest with pytest -o markers=task or use the PYTEST_ADOPTS env var to get the warnings to disappear.
Reacted by Matt Jones Kelley and Joseph Wilson (TW-42688)
After discussing this with @ErikSchierboom, the ultimate resolution will be to place our pytest.ini file in python/exercises/shared/, so that it can be dowloaded via the CLI.
However, that download behavior is not yet supported, so in the interim, we will have setup notes/instructions for students to download the file from the repo to copy into their root python/ folder, or have them create an ini file in that location.
via PR #2806, made a copy of the pytest.ini file in exercises/shared. Testing docs have been updated. Once the file is downloadable via CLI, we can close this issue.
changed the title [-]Eliminate spurious Pytest warnings about unregistered marks[/-][+][Pytest Tooling] Eliminate spurious Pytest warnings about unregistered marks[/+]on Jan 21, 2022
Linking closed issue #2539, as the documentation is still not ideal around this issue. Will be opening separate issues for updating documentation to make it clearer what needs to happen for students to set this up properly.
@ErikSchierboom -- tagging you because we discussed a while ago having the pytest.ini download via the CLI, and I'm not sure where we are on that front. (no worries if there is a delay -- I just don't want to forget about it.)
I have updated our testing documentation, and that has helped with this issue a lot -- but would also love to have the config file available via CLI in exercises/shared if possible... just let me know. Thanks! 😄
Tagging this as officially "on hold" for the auto-download option. Since we've changed the docs to clarify, this feels somewhat lower-priority at this stage.
Activity
github-actions commentedon Nov 9, 2021
jaywritescode commentedon Nov 9, 2021
Taking a second look, there is the appropriate
pytest.inifile in this repo; however, it's not being copied into the individual exercise packages.BethanyG commentedon Nov 10, 2021
Hi @jaywritescode,
Thanks for logging this issue. The warnings should vanish if you place the
inifile in the root of the exercise folder (e.g. underpython/. You shouldn't need a copy in the individual exercise folders. We're investigating why it isn't currently downloading with the exercises.Additionally, you can run pytest with
pytest -o markers=taskor use thePYTEST_ADOPTSenv var to get the warnings to disappear.BethanyG commentedon Nov 10, 2021
Flagging this as a bug, since we haven't (yet) figured out how to get this to download with the CLI.
BethanyG commentedon Nov 13, 2021
After discussing this with @ErikSchierboom, the ultimate resolution will be to place our
pytest.inifile inpython/exercises/shared/, so that it can be dowloaded via the CLI.However, that download behavior is not yet supported, so in the interim, we will have setup notes/instructions for students to download the file from the repo to copy into their root
python/folder, or have them create aninifile in that location.BethanyG commentedon Nov 28, 2021
via PR #2806, made a copy of the
pytest.inifile inexercises/shared. Testing docs have been updated. Once the file is downloadable via CLI, we can close this issue.[-]Eliminate spurious Pytest warnings about unregistered marks[/-][+][Pytest Tooling] Eliminate spurious Pytest warnings about unregistered marks[/+]BethanyG commentedon Feb 19, 2022
Linking closed issue #2539, as the documentation is still not ideal around this issue. Will be opening separate issues for updating documentation to make it clearer what needs to happen for students to set this up properly.
Updated help and tooling docs per issues exercism#2953 and exercism#2745
Updated help and tooling docs per issues exercism#2953 and exercism#2745
Updated help and tooling docs per issues #2953 and #2745
BethanyG commentedon May 6, 2022
@ErikSchierboom -- tagging you because we discussed a while ago having the
pytest.inidownload via the CLI, and I'm not sure where we are on that front. (no worries if there is a delay -- I just don't want to forget about it.)I have updated our testing documentation, and that has helped with this issue a lot -- but would also love to have the config file available via CLI in
exercises/sharedif possible... just let me know. Thanks! 😄ErikSchierboom commentedon May 10, 2022
Yeah, sorry, that has not yet been implemented. I'll let you know when I get to that (such a huge list of TODOs :D)
BethanyG commentedon May 21, 2022
Tagging this as officially "on hold" for the auto-download option. Since we've changed the docs to clarify, this feels somewhat lower-priority at this stage.