Unknown mark warning
See original GitHub issueWhen 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:
- Created 4 years ago
- Reactions:2
- Comments:10
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Same here with
pytest.mark.first
even though it works as intendedpytest-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!