Skip to content

Test collection is 10x slower on 9.1.1 compared to 9.0.3 #14942

Description

@mikicz

Hello!

After upgrading to 9.1.1 from 9.0.3 (and no other code changes, only one config change), running pytest --collect-only is around 10x slower.

On 9.0.3: 30406/30495 tests collected (89 deselected) in 30.22s

On 9.1.1: 30406/30495 tests collected (89 deselected) in 303.61s (0:05:03)

The only thing that changed between the two runs was adding this to filterwarnings (as we have a lot of class based fixtures)

ignore:.*Class-scoped fixture defined as instance method.*:pytest.PytestRemovedIn10Warning

I did some profiling with pyinstrument, it seems that most of the time is now spent in is_visibility_more_specific from FixtureManager.parsefactories

The codebase has a lot of class-based tests, but I can't share the code unfortunately.

I do appreciate there is not a lot to go on here, please lmk what other info I could provide to make the debugging easier!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions