Skip to content

Reduce pytest's overhead for running tests #401

Closed
@pytestbot

Description

@pytestbot

Originally reported by: Alex Gaynor (BitBucket: alex_gaynor, GitHub: alex_gaynor)


Consider this example:

import time

import pytest


@pytest.mark.parametrize("x", xrange(5000))
def test_foo(x):
    time.sleep(.001)

5000 tests * .001 seconds each = expected about 5 seconds of runtime. Add a second or two for overhead.

On my system this actually takes about 15 seconds. As you add more and more tests, this overhead appears to be linear (10,000 tests takes ~30 seconds).


Metadata

Metadata

Assignees

No one assigned

    Labels

    type: enhancementnew feature or API change, should be merged into features branch

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions