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

Unknown marking detected by pytest: pytest.mark.task #2536

Closed
eirnym opened this issue Sep 3, 2021 · 4 comments
Closed

Unknown marking detected by pytest: pytest.mark.task #2536

eirnym opened this issue Sep 3, 2021 · 4 comments
Labels

Comments

@eirnym
Copy link

eirnym commented Sep 3, 2021

This marker seems to be not defined anywhere on resources given to a student (see docs folder). Thus with typical installation using virtual environment with only pytest and pytest-cache installed as suggested in TEST.md file, a student will get a warning such as below. I suggest to extend documentation or a setup, which student downloads using exercism command by including this mark at least as suggested in official documentation

filename_test.py: 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=5)
@BethanyG
Copy link
Member

BethanyG commented Sep 4, 2021

Hi @eirnym 👋🏽 Thanks for logging this issue! Yes - agree we should have instructions (at the very least) on how to register the marks - or a pytest.ini file that can be used so that PyTest won't complain locally.

The marks are not for selecting tests or resources -- they're being used by our track test runner to associate Concept exercise task numbers to tests, so that the website UI display can show the test code in task order after a test run (the web UI doesn't display the test file for concept exercises).

We use the same test files for the website that are downloaded via the CLI -- so unfortunately, the mark shows up for local runs as well. If you are curious about the test runner interface, you can take a look at this specification for track test runners.

The marks aren't being used meaningfully in the CLI context right now.

We haven't gotten around to updating the "run this locally" documentation yet with register/disable/config info. 😅 Hopefully, we can do that soon, and also include a pytest.ini file as part of the general exercise download.

Meanwhile, you can avoid the nag by running pytest locally with the --disable-pytest-warnings flag, or adding the following in a pytest.ini file in the exercism python directory:

[pytest]
markers =
    task: A concept exercise task.

@BethanyG
Copy link
Member

BethanyG commented Sep 4, 2021

I've logged the ini file and documentation tasks as bug #2539.

@eirnym
Copy link
Author

eirnym commented Sep 4, 2021

why this issue is not a bug report?

@BethanyG
Copy link
Member

BethanyG commented Sep 4, 2021

Because I was tired, and had also re-logged this as issue #2539, for clarity in what needs changing. 😄 Closing this now in favor of that issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants