Skip to content

Skipped test with the skip decorator reports test results as unknown #77

@gchan

Description

@gchan

PyTest tests skipped with the @pytest.mark.skip decorator [1] appear to report the test result as unknown to Test Engine.

Tests dynamically skipped with xfail or pytest.skip are unaffected and report the correct result.

Here's a copy of the debug output

❯ BUILDKITE_ANALYTICS_DEBUG_ENABLED=1 pytest tests/test_skipped.py
========================================================================================================= test session starts ==========================================================================================================
platform darwin -- Python 3.13.2, pytest-8.4.1, pluggy-1.6.0
rootdir: ..../test-engine-client-examples/pytest
plugins: buildkite-test-collector-1.1.1, xdist-3.8.0
collected 1 item
buildkite-test-collector - DEBUG - hook=pytest_runtest_logstart nodeid=tests/test_skipped.py::test_skipped_example
buildkite-test-collector - DEBUG - -> started_at=Instant(seconds=65273.672679541)(monotonic)

tests/test_skipped.py buildkite-test-collector - DEBUG - hook=pytest_runtest_makereport nodeid=tests/test_skipped.py::test_skipped_example when=setup
buildkite-test-collector - DEBUG - hook=pytest_runtest_logreport nodeid=tests/test_skipped.py::test_skipped_example when=setup
sbuildkite-test-collector - DEBUG - hook=pytest_runtest_makereport nodeid=tests/test_skipped.py::test_skipped_example when=teardown
buildkite-test-collector - DEBUG - -> finalize_test nodeid=tests/test_skipped.py::test_skipped_example
buildkite-test-collector - DEBUG - -> finalize_test nodeid=tests/test_skipped.py::test_skipped_example duration=0:00:00.000319
buildkite-test-collector - DEBUG - hook=pytest_runtest_logreport nodeid=tests/test_skipped.py::test_skipped_example when=teardown
buildkite-test-collector - DEBUG - hook=pytest_runtest_logfinish nodeid=tests/test_skipped.py::test_skipped_example
buildkite-test-collector - DEBUG - -> finalize_test nodeid=tests/test_skipped.py::test_skipped_example
buildkite-test-collector - DEBUG - -> finalize_test: not in flight: tests/test_skipped.py::test_skipped_example

Internal reference: https://linear.app/buildkite/issue/TE-4941#comment-4bba1eaa

[1] https://docs.pytest.org/en/stable/how-to/skipping.html#skipping-test-functions

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions