question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unknown mark warning

See original GitHub issue

When I use the following code to mark a whole test file to be run last:

pytestmark = pytest.mark.last

I always get the following warning at the end of the test run:

=========================== warnings summary ============================
c:\users\rnd10\appdata\local\programs\python\python37-32\lib\site-packages\_pytest\mark\structures.py:332
  c:\users\rnd10\appdata\local\programs\python\python37-32\lib\site-packages\_pytest\mark\structures.py:332: PytestUnknownMarkWarning: Unknown pytest.mark.last - is this a typo?  You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/latest/mark.html
    PytestUnknownMarkWarning,

-- Docs: https://docs.pytest.org/en/latest/warnings.html

Note that the ordering works as expected. My version info:

platform win32 -- Python 3.7.3, pytest-5.0.1, py-1.8.0, pluggy-0.12.0
plugins: cov-2.7.1, ordering-0.6, pycharm-0.5.0

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:2
  • Comments:10

github_iconTop GitHub Comments

3reactions
zicviccommented, Jan 31, 2020

Same here with pytest.mark.first even though it works as intended

2reactions
bnavigatorcommented, Apr 29, 2021

pytest-ordering des not look like it is still maintained. Use pytest-order instead. Or even better: Make your tests independent of each other, putting common setup and teardown stuff into fixtures!

Read more comments on GitHub >

github_iconTop Results From Across the Web

PytestUnknownMarkWarning: Unknown pytest.mark.xxx - is ...
[pytest] markers = webtest: mark a test as a webtest. Next time you run the tests, the warning about the unregistered marker will...
Read more >
pytest.mark.usefixture("base_fixture") | Selenium Python Forum
I am getting warning messagae "PytestUnknownMarkWarning: Unknown pytest.mark.usefixgture - @pytest.mark.usefixture("base_fixture") while ...
Read more >
Unknown pytest.mark.xxx – is this a typo
I have a file called test.py with the following code: import pytest @pytest.mark.webtest def test_http_request(): pass class TestClass: def ...
Read more >
How to capture warnings
content of test_show_warnings.py import warnings def api_v1(): ... You can use the @pytest.mark.filterwarnings to add warning filters to specific test items ...
Read more >
pytestunknownmarkwarning: unknown pytest.mark.yyy
[pytest] markers = webtest: mark a test as a webtest. Next time you run the tests, the warning about the unregistered marker will...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found