Skip to content

Tests take longer to run when coverage context is recorded, expected? #793

@fersarr

Description

@fersarr

Perhaps you are already aware of this and it is expected, but at least for the purpose of documenting it:

Running tests while recording coverage context for who-tests-what (by using the .coveragerc mentioned below), takes considerably longer than usual. As a small example, running 300 unit tests used to take 15 seconds and with this it takes around 50 seconds. On bigger batches of tests it became quite impactful. Perhaps this is all expected.

The .coveragerc file is:

[run]
dynamic_context = test_function

As described in https://nedbatchelder.com/blog/201810/who_tests_what_is_here.html

The command was:

python coverage run -p --branch /path/py.test tests/unit/module/

Measured on:

Python==3.6.5
coverage==5.0a4

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions