Skip to content

Markers

Testudos ships three pre-built pytest markers for tagging tests, and picks up any other marker you use automatically. Markers show up in the generated report (see Test Reports) and are captured whether or not you’re generating a report at all.

Built-in markers

Three built-in markers add extra detail to a test’s report entry. All are optional - use any, all, or none:

@pytest.mark.tc_desc("logging in with valid credentials switches to the dashboard")
@pytest.mark.tc_req_id("REQ-101")
@pytest.mark.tc_req_link("https://requirements.example.com/REQ-101")
def test_login_button_works(testudos_client):
...
  • tc_desc("...") - a human-readable description of the test case.
  • tc_req_id("...") - a linked requirement’s identifier. Stack the decorator to link more than one.
  • tc_req_link("...") - a link to that requirement’s own documentation/tracker entry. Also stackable.

These three are registered with pytest automatically - no settings file, no flag - so they never trigger PytestUnknownMarkWarning or fail under --strict-markers.

Defining your own custom markers

Any other marker works too, with no code changes needed. For example:

@pytest.mark.owner("qa-team")
def test_login_button_works(testudos_client):
...

It’s captured into the report automatically, even without being registered anywhere, but:

  • Pytest emits an Unknown pytest.mark.<name> warning (and fails the run under --strict-markers).
  • If a report is generated, the marker shows up with its raw name and value (e.g. owner: qa-team) instead of the friendly label a custom_markers entry would have given it.

To register it (so it gets a friendly label in reports and stops warning), add it to a settings file’s custom_markers list:

{
"custom_markers": [
{"name": "owner", "label": "Owned by"}
]
}

Save it as testudos-settings.json in your project root and pytest picks it up automatically.

You can also point at a differently named or located file explicitly:

Terminal window
pytest --testudos-settings=settings.json