Skip to content

Commit

Permalink
Fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
pablogsal committed Nov 16, 2024
1 parent 971f51e commit a87f6df
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
5 changes: 4 additions & 1 deletion src/pytest_pystack/_monitor_process.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down
6 changes: 5 additions & 1 deletion src/pytest_pystack/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down
5 changes: 2 additions & 3 deletions tests/test_pytest_pystack.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

import pytest


SLEEPING_TEST_TEMPLATE = """
import time
def test_sleeping_test():
Expand Down Expand Up @@ -313,7 +312,7 @@ def test_pytester_compat(testdir, capfd, monkeypatch):

monkeypatch.chdir(testdir.tmpdir)
testdir.makepyfile(
"""
"""
pytest_plugins = 'pytester'
test_file ='''
Expand All @@ -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

0 comments on commit a87f6df

Please sign in to comment.