Skip to content

Commit

Permalink
Adjust test_Plot() for Python 3.12
Browse files Browse the repository at this point in the history
  • Loading branch information
khaeru committed Oct 27, 2023
1 parent 6c41e2c commit 6055c9d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions genno/tests/compat/test_plotnine.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,12 @@ def test_Plot(caplog, tmp_path):

with pytest.raises(
TypeError,
# the plural "s" appears in Python <=3.8, but not in Python 3.9
# Messages vary by Python version:
# - ≤3.8 : "…with abstract methods generate"
# - 3.9–3.11: "…with abstract method generate" (no s)
# - 3.12 : "…without an implementation for abstract method 'generate'"
match=(
"Can't instantiate abstract class Plot1 with abstract methods? generate"
"Can't instantiate abstract class Plot1 with.* abstract method.*generate"
),
):
c.add("plot", Plot1)
Expand Down

0 comments on commit 6055c9d

Please sign in to comment.