Skip to content

Commit 5427517

Browse files
committed
change(plugins/consume): Enable strict exception matching by default
1 parent fa708fb commit 5427517

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

Diff for: src/pytest_plugins/consume/hive_simulators/conftest.py

+8-8
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,12 @@ def pytest_addoption(parser):
4343
help="Log the timing data for each test case execution.",
4444
)
4545
consume_group.addoption(
46-
"--strict-exception-matching",
46+
"--disable-strict-exception-matching",
4747
action="store",
48-
dest="strict_exception_matching",
48+
dest="disable_strict_exception_matching",
4949
default="",
5050
help=(
51-
"Comma-separated list of the names of clients which should use strict "
51+
"Comma-separated list of the names of clients which should NOT use strict "
5252
"exception matching."
5353
),
5454
)
@@ -220,19 +220,19 @@ def client_exception_mapper(
220220

221221

222222
@pytest.fixture(scope="session")
223-
def strict_exception_matching(request: pytest.FixtureRequest) -> List[str]:
224-
"""Return the list of clients that should use strict exception matching."""
225-
config_string = request.config.getoption("strict_exception_matching")
223+
def disable_strict_exception_matching(request: pytest.FixtureRequest) -> List[str]:
224+
"""Return the list of clients that should NOT use strict exception matching."""
225+
config_string = request.config.getoption("disable_strict_exception_matching")
226226
return config_string.split(",") if config_string else []
227227

228228

229229
@pytest.fixture(scope="function")
230230
def client_strict_exception_matching(
231231
client_type: ClientType,
232-
strict_exception_matching: List[str],
232+
disable_strict_exception_matching: List[str],
233233
) -> bool:
234234
"""Return True if the client type should use strict exception matching."""
235-
return any(client in client_type.name for client in strict_exception_matching)
235+
return not any(client in client_type.name for client in disable_strict_exception_matching)
236236

237237

238238
@pytest.fixture(scope="function")

0 commit comments

Comments
 (0)