Skip to content

Context manager to disable logging handler #56

Closed
@nicoddemus

Description

@nicoddemus

Add a context manager to qtlog fixture that disables the custom handler:

def test_foo(qtlog):
    with qtlog.disabled():
         # in this block the original qInstallMsgHandler function is active

Also implement a mark which does the same thing but for the entire test:

@pytest.mark.no_qt_log
def test_foo(qtlog):
     # in this test the original qInstallMsgHandler function is active

(Feature idea from @The-Compiler in #54).

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