Skip to content

Commit

Permalink
Use regex in test
Browse files Browse the repository at this point in the history
Co-authored-by: Stefanie Molin <[email protected]>
  • Loading branch information
JCGoran and stefmolin authored Aug 18, 2024
1 parent f789593 commit 84239ae
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions tests/shapes/bases/test_line_collection.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,10 @@ def test_line_as_point(self, line):

def test_repr(self, line_collection):
"""Test that the __repr__() method is working."""
lines = r"""<LineCollection>
lines=
array([[0., 0.],
[0., 1.]])
array([[1., 0.],
[1., 1.]])
array([[10.5, 11.5],
[11. , 10. ]])"""
assert repr(line_collection) == lines
assert (
re.match(
r"""<LineCollection>\n lines=\n {8}array\(\[\[\d+""",
repr(line_collection),
)
is not None
)

0 comments on commit 84239ae

Please sign in to comment.