Skip to content

xdist vs --last-failed at test-session-start banner #880

@mulawamichal

Description

@mulawamichal

i noticed, that using xdist causes --lf banner do not show up. when calling my tests with --lf and without -n i can see eg:

============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-7.0.1, pluggy-1.0.0
cachedir: (...)
rootdir: (...)
plugins: html-3.1.1, forked-1.4.0, lazy-fixture-0.6.3, logger-0.5.1, qgp-0.4.3, typeguard-2.12.1, timeout-2.0.2, xdist-2.5.0, metadata-1.11.0, repeat-0.9.1
timeout: 150.0s
timeout method: thread
timeout func_only: False
collected 3 items
run-last-failure: rerun previous 3 failures (skipped 4 files)

(and the actual tests here)

but when running with xdist (-n auto), it overwrites the "colection" stuff with worker presentation:

============================= test session starts ==============================
platform linux -- Python 3.6.9, pytest-7.0.1, pluggy-1.0.0
cachedir: (...)
rootdir: (...)
plugins: html-3.1.1, forked-1.4.0, lazy-fixture-0.6.3, logger-0.5.1, qgp-0.4.3, typeguard-2.12.1, timeout-2.0.2, xdist-2.5.0, metadata-1.11.0, repeat-0.9.1
timeout: 150.0s
timeout method: thread
timeout func_only: False
gw0 I / gw1 I / gw2 I / gw3 I / gw4 I / gw5 I / gw6 I / gw7 I / gw8 I / gw9 I / gw10 I / gw11 I / gw12 I / gw13 I / gw14 I / gw15 I / gw16 I / gw17 I / gw18 I / gw19 I / gw20 I / gw21 I / gw22 I / gw23 I
gw0 [3] / gw1 [3] / gw2 [3] / gw3 [3] / gw4 [3] / gw5 [3] / gw6 [3] / gw7 [3] / gw8 [3] / gw9 [3] / gw10 [3] / gw11 [3] / gw12 [3] / gw13 [3] / gw14 [3] / gw15 [3] / gw16 [3] / gw17 [3] / gw18 [3] / gw19 [3] / gw20 [3] / gw21 [3] / gw22 [3] / gw23 [3]

(and the actual tests here)

the overall test count is still available in the sqare braces ([3]), but that last-failed collection stuff is actually useful and would be nice to still have it:

run-last-failure: rerun previous 3 failures (skipped 4 files)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions