{"id":952,"hash":"be65968faf0ceaf7551e083bf275121c03e5656748ea901e51ab7b4389f18291","pattern":"PytestUnknownMarkWarning: Unknown pytest.mark.xxx - is this a typo?","full_message":"I have a file called test.py with the following code:\n\nimport pytest\n\n@pytest.mark.webtest\ndef test_http_request():\n    pass\n\nclass TestClass:\n    def test_method(self):\n        pass\n\npytest -s test.py passed but gave the following warnings:\n\npytest -s test.py\n=============================== test session starts ============================\nplatform linux -- Python 3.7.3, pytest-5.2.4, py-1.8.0, pluggy-0.13.1\nrootdir: /home/user\ncollected 2 items\n\ntest.py ..\n\n=============================== warnings summary ===============================\nanaconda3/lib/python3.7/site-packages/_pytest/mark/structures.py:325\n  ~/anaconda3/lib/python3.7/site-packages/_pytest/mark/structures.py:325:\n    PytestUnknownMarkWarning: Unknown pytest.mark.webtest - is this a typo?  You can register\n    custom marks to avoid this warning - for details, see https://docs.pytest.org/en/latest/mark.html\n    PytestUnknownMarkWarning,\n\n-- Docs: https://docs.pytest.org/en/latest/warnings.html\n=============================== 2 passed, 1 warnings in 0.03s ===================\n\nEnvironment: Python 3.7.3, pytest 5.2.4, anaconda3\n\nWhat is the best way to get rid of the warning message?","ecosystem":"pypi","package_name":"python-3.x","package_version":null,"solution":"To properly handle this you need to register the custom marker. Create a pytest.ini file and place the following inside of it.\n\n[pytest]\nmarkers =\n    webtest: mark a test as a webtest.\n\nNext time you run the tests, the warning about the unregistered marker will not be there.","confidence":0.95,"source":"stackoverflow","source_url":"https://stackoverflow.com/questions/60806473/pytestunknownmarkwarning-unknown-pytest-mark-xxx-is-this-a-typo","votes":54,"created_at":"2026-04-19T04:52:04.244430+00:00","updated_at":"2026-04-19T04:52:04.244430+00:00"}