Skip to content

Commit 129486a

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent f546121 commit 129486a

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

conftest.py

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
1-
import pytest
2-
31
def pytest_addoption(parser):
42
parser.addoption(
53
"--force-log-cli",
64
action="store_true",
75
help="Force enable log_cli even when xdist is active",
86
)
97

8+
109
def pytest_configure(config):
1110
# Detect if xdist (parallel execution) is active
12-
xdist_active = hasattr(config, "workerinput") or config.pluginmanager.hasplugin("xdist")
13-
import pytest
11+
xdist_active = hasattr(config, "workerinput") or config.pluginmanager.hasplugin(
12+
"xdist"
13+
)
14+
1415

1516
def pytest_addoption(parser):
1617
parser.addoption(
@@ -19,9 +20,12 @@ def pytest_addoption(parser):
1920
help="Force enable log_cli even when xdist is active",
2021
)
2122

23+
2224
def pytest_configure(config):
2325
# Detect if xdist (parallel execution) is active
24-
xdist_active = hasattr(config, "workerinput") or config.pluginmanager.hasplugin("xdist")
26+
xdist_active = hasattr(config, "workerinput") or config.pluginmanager.hasplugin(
27+
"xdist"
28+
)
2529

2630
if not xdist_active or config.getoption("--force-log-cli"):
2731
# Normal run (no xdist): enable live logs

test_sample.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
import time
22

3+
34
def test_example_1():
45
time.sleep(0.5)
56
assert 1 == 1
67

8+
79
def test_example_2():
810
time.sleep(0.5)
911
assert 2 == 2

0 commit comments

Comments
 (0)