Skip to content

Don't keep references to TestCase objects #191

@mdickinson

Description

@mdickinson

Currently, the test runner keeps references to all TestCase objects until the end of the run; that means that resources referred to by TestCase attributes are kept around until the end of the test run. That can lead to false positive reports of leaked objects. (In the case that provoked this report, we were tracking Qt QObjects alive before and after each test method.)

unittest used to behave the same way (and still does for Python 2.x), but the behaviour was changed for Python 3.4. See https://bugs.python.org/issue11798

While I'd argue that individual TestCase objects should still be cleaning up after themselves anyway, it would be good to at least have the option to remove those objects once each test has been run.

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