Skip to content

pytest: dynamically determine verbosity level #8

Description

@giampaolo

We have a MemoryLeakTestCase.verbosity parameter which determines whether to print diagnostic messages while tests are being run. If set to 1 we'll see:

tests/test_interface.py::TestMisc::test_trim_callback 
Run # 1: heap=+560                                          (calls=  50, avg/call=+11)
Run # 2: heap=+528                                          (calls=  75, avg/call=+7)
Memory stabilized (no further growth detected)
PASSED

It would be nice to determine whether pytest was invoked with -v / --verbose at runtime, and set verbosity = 1 in accordance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions