From a87f6dfbca44466de14e3771727b007235186fc3 Mon Sep 17 00:00:00 2001 From: Pablo Galindo Date: Sat, 16 Nov 2024 19:55:40 +0000 Subject: [PATCH] Fix formatting --- src/pytest_pystack/_monitor_process.py | 5 ++++- src/pytest_pystack/plugin.py | 6 +++++- tests/test_pytest_pystack.py | 5 ++--- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/pytest_pystack/_monitor_process.py b/src/pytest_pystack/_monitor_process.py index 9f9b698..b24fa0a 100644 --- a/src/pytest_pystack/_monitor_process.py +++ b/src/pytest_pystack/_monitor_process.py @@ -55,7 +55,10 @@ def _run_monitor(config: PystackConfig, pid, queue): try: new_testcase = queue.get(timeout=config.threshold) if new_testcase != testcase: - print(f"new test {new_testcase} should not start before previous {testcase} test finished", file=sys.__stderr__) + print( + f"new test {new_testcase} should not start before previous {testcase} test finished", + file=sys.__stderr__, + ) raise Exception( "new test should not start before previous test finished" ) diff --git a/src/pytest_pystack/plugin.py b/src/pytest_pystack/plugin.py index 563d1e8..1169e47 100644 --- a/src/pytest_pystack/plugin.py +++ b/src/pytest_pystack/plugin.py @@ -62,7 +62,11 @@ def pytest_addoption(parser) -> None: @pytest.hookimpl def pytest_runtest_makereport(item, call): - if call.when in {"setup", "teardown"} and item.config._pystack_queue and "pytester" not in item.fixturenames: + if ( + call.when in {"setup", "teardown"} + and item.config._pystack_queue + and "pytester" not in item.fixturenames + ): item.config._pystack_queue.put(item.name) diff --git a/tests/test_pytest_pystack.py b/tests/test_pytest_pystack.py index 3ef2f06..a495943 100644 --- a/tests/test_pytest_pystack.py +++ b/tests/test_pytest_pystack.py @@ -4,7 +4,6 @@ import pytest - SLEEPING_TEST_TEMPLATE = """ import time def test_sleeping_test(): @@ -313,7 +312,7 @@ def test_pytester_compat(testdir, capfd, monkeypatch): monkeypatch.chdir(testdir.tmpdir) testdir.makepyfile( - """ + """ pytest_plugins = 'pytester' test_file =''' @@ -336,6 +335,6 @@ def test_pytester(pytester): # check that all 1 test passed result.assert_outcomes(passed=1) - + _, stderr = capfd.readouterr() assert not stderr