Skip to content

Commit 7f3bec7

Browse files
authored
Update src/_pytest/unittest.py
1 parent 395208c commit 7f3bec7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/_pytest/unittest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -405,8 +405,8 @@ class TwistedVersion(Enum):
405405

406406

407407
def _get_twisted_version() -> TwistedVersion:
408-
# Check `"twisted.trial.unittest` is in sys.modules to ensure that Twisted is installed
409-
# being used to run the test suite.
408+
# We need to check if "twisted.trial.unittest" is specifically present in sys.modules.
409+
# This is because we intend to integrate with Trial only when it's actively running the test suite, but not needed when only other Twisted components are in use.
410410
if "twisted.trial.unittest" not in sys.modules:
411411
return TwistedVersion.NotInstalled
412412

0 commit comments

Comments
 (0)