11import re
2+ from collections .abc import Sequence
23
34import pytest
4- from base_tester import BasePytestTester
55
66from pylint_pytest .checkers .fixture import FixtureChecker
77
8+ from .base_tester import BasePytestTester
9+
810
911class TestCannotEnumerateFixtures (BasePytestTester ):
1012 CHECKER_CLASS = FixtureChecker
@@ -18,6 +20,9 @@ def test_no_such_package(self, enable_plugin):
1820 if enable_plugin :
1921 msg = self .msgs [0 ]
2022
23+ assert isinstance (msg .args , Sequence )
24+ assert len (msg .args ) == 3
25+
2126 # Asserts/Fixes duplicate filenames in output:
2227 # https://github.com/reverbc/pylint-pytest/pull/22/files#r698204470
2328 filename_arg = msg .args [0 ]
@@ -28,7 +33,7 @@ def test_no_such_package(self, enable_plugin):
2833
2934 # Assert `stdout` is non-empty.
3035 assert msg .args [1 ]
31- # Assert `stderr` is empty (pytest runs stably, even though fixture collection fails).
36+ # Assert `stderr` is empty (pytest runs stably, even if the fixture collection fails).
3237 assert not msg .args [2 ]
3338
3439 @pytest .mark .parametrize ("enable_plugin" , [True , False ])
@@ -39,6 +44,9 @@ def test_import_corrupted_module(self, enable_plugin):
3944 if enable_plugin :
4045 msg = self .msgs [0 ]
4146
47+ assert isinstance (msg .args , Sequence )
48+ assert len (msg .args ) == 3
49+
4250 # ... somehow, since `import_corrupted_module.py` imports `no_such_package.py`
4351 # both of their names are returned in the message.
4452 filename_arg = msg .args [0 ]
0 commit comments