Skip to content

Commit 09b2ed9

Browse files
committed
Better pytest conftest
1 parent 51248c0 commit 09b2ed9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tests/conftest.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,5 @@ def pytest_configure(config):
77

88
def pytest_unconfigure(config):
99
import sys
10-
del sys._called_from_pytest
10+
if hasattr(sys, "_called_from_pytest"):
11+
del sys._called_from_pytest

0 commit comments

Comments
 (0)