From ec08a06e57dea7d4c21930736adbb624a78ad215 Mon Sep 17 00:00:00 2001 From: Dylan Pulver Date: Sat, 31 Oct 2026 07:51:41 -0400 Subject: [PATCH] Run the two assertions that sit inside pytest.raises blocks `test_convert_output_multiple_column_error` and `test_create_error_if_invalid_self_referential_foreign_keys` each put their assertion inside the `with pytest.raises(...)` block, after the call that raises, so neither has ever run. The body has to raise for the test to pass and an assert can only raise AssertionError, so the raiser always precedes the assertion. The effect is that `pytest.raises` pins the exception type while the message goes unchecked. Both assertions pass once they execute, so no expectation needed updating. Rewording either message now fails the matching test, where before this change both still passed. tests/test_convert.py and tests/test_create.py stay at 218 passed, 1 skipped. `black --check` and `flake8` are clean. --- tests/test_convert.py | 3 ++- tests/test_create.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/test_convert.py b/tests/test_convert.py index 1f9e9ed15..3eca4cca1 100644 --- a/tests/test_convert.py +++ b/tests/test_convert.py @@ -80,7 +80,8 @@ def test_convert_output_multiple_column_error(fresh_db): table = fresh_db.table("table") with pytest.raises(ValueError) as excinfo: table.convert(["title", "other"], lambda v: v, output="out") - assert "output= can only be used with a single column" in str(excinfo.value) + + assert "output= can only be used with a single column" in str(excinfo.value) @pytest.mark.parametrize( diff --git a/tests/test_create.py b/tests/test_create.py index b738df952..b4a8e1e73 100644 --- a/tests/test_create.py +++ b/tests/test_create.py @@ -340,7 +340,8 @@ def test_create_error_if_invalid_self_referential_foreign_keys(fresh_db): pk="id", foreign_keys=(("ref_id", "one", "bad_column"),), ) - assert ex.value.args == ("No such column: one.bad_column",) + + assert ex.value.args == ("No such column: one.bad_column",) @pytest.mark.parametrize(