Skip to content

Commit

Permalink
Bugfix: regex should be a raw string
Browse files Browse the repository at this point in the history
  • Loading branch information
jsiirola authored Jul 9, 2024
1 parent df73348 commit 643c0e5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pyomo/core/tests/unit/test_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -6459,7 +6459,7 @@ def test_issue_3284(self):
problem.subset_A.add(4)
# set subset_B
problem.subset_B.add((3, 4))
with self.assertRaisesRegex(ValueError, ".*Cannot add value \(7, 8\)"):
with self.assertRaisesRegex(ValueError, r".*Cannot add value \(7, 8\)"):
problem.subset_B.add((7, 8))
# set subset_C
problem.subset_C[2].add(7)
Expand All @@ -6475,7 +6475,7 @@ def test_issue_3284(self):
problem.E[1].add(4)
# set F
problem.F[(1, 2, 3)].add((3, 4))
with self.assertRaisesRegex(ValueError, ".*Cannot add value \(4, 3\)"):
with self.assertRaisesRegex(ValueError, r".*Cannot add value \(4, 3\)"):
problem.F[(4, 5, 6)].add((4, 3))
# check them
self.assertEqual(list(problem.A), [1, 2, 3])
Expand Down

0 comments on commit 643c0e5

Please sign in to comment.