Skip to content

Add duration information to tests #106

Open
@jvperrin

Description

Having duration information like in ocfweb would be nice, however currently it doesn't work because of freezegun. I think some more debugging is needed to get the two working well together (or maybe file an issue/PR on either pytest or freezegun). The current output is something like this, which is obviously false:

============================================= slowest 10 test durations ==============================================
71063314.99s teardown tests/lab/hours_test.py::TestDay::test_creation[None-Saturday-None-hours5]
71063314.92s teardown tests/lab/hours_test.py::TestDay::test_creation[when4-Sunday-Random 3 Days-hours4]
71063314.84s teardown tests/lab/hours_test.py::TestDay::test_creation[when3-Saturday-Pi Day-hours3]
71063314.77s teardown tests/lab/hours_test.py::TestDay::test_creation[when2-Wednesday-None-hours2]
71063314.70s teardown tests/lab/hours_test.py::TestDay::test_creation[when1-Sunday-None-hours1]
71063314.63s teardown tests/lab/hours_test.py::TestDay::test_creation[when0-Sunday-None-hours0]
71063314.51s teardown tests/lab/hours_test.py::test_is_open[now12-False]
71063314.43s teardown tests/lab/hours_test.py::test_is_open[now11-True]
71063314.36s teardown tests/lab/hours_test.py::test_is_open[now10-True]
71063314.29s teardown tests/lab/hours_test.py::test_is_open[now9-True]

A possible workaround I suppose would be to make the time used in the freezegun mock something long in the future so that the time is then negative? Doesn't seem great though :(

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions