Skip to content

Add support for markers in doctests #5794

Open
@hmoravec

Description

@hmoravec

It would be useful if also classes / methods / functions with doctests could be marked:

import pytest

@pytest.mark.custom_marker
def return_true():
    """Return True.

    >>> return_true()
    True
    """"
    return True

and then selected
$ pytest -m custom_marker

Metadata

Metadata

Assignees

No one assigned

    Labels

    plugin: doctestsrelated to the doctests builtin plugintopic: marksrelated to marks, either the general marks or builtintype: enhancementnew feature or API change, should be merged into features branch

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions