Skip to content
This repository was archived by the owner on May 13, 2025. It is now read-only.
This repository was archived by the owner on May 13, 2025. It is now read-only.

[Python] set up a common file for test markers/decorators (e.g., to mark flaky, excluded, slow, etc) #407

@suntzu86

Description

@suntzu86

pytest provides a nice framework for skipping tests. It can handle conditionals, expected failures, and much more:
http://pytest.org/latest/skipping.html

e.g., skipping tests that are marked slow is as easy as:
http://pytest.org/latest/example/simple.html#control-skipping-of-tests-according-to-command-line-option

The system relies on devs decorating tests consistently with pytest.mark subclasses. They suggest:

For larger test suites it’s usually a good idea to have one file where you define the markers which you then consistently apply throughout your test suite.

We should set up such a file for ourselves. At the minimum it should have a standard way of marking tests as "excluded" so we can quickly disable them. (There's even frameworks for rerunning flaky tests automatically: https://github.com/box/flaky)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions