-
Notifications
You must be signed in to change notification settings - Fork 24
Closed
Description
The test below fails intermittently.
__________________________ test_triangle_orientation ___________________________
@given(coord, coord, coord, coord, coord, coord)
> @hyp_settings
def test_triangle_orientation(ax, ay, bx, by, cx, cy):
spatialpandas/tests/geometry/algorithms/test_orientation.py:9:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
ax = 0.0, ay = -4.440892098500627e-13, bx = 6.661338147750941e-13
by = 2.2204460492503136e-13, cx = 4.440892098500627e-13, cy = 0.0
@given(coord, coord, coord, coord, coord, coord)
@hyp_settings
def test_triangle_orientation(ax, ay, bx, by, cx, cy):
result = triangle_orientation(ax, ay, bx, by, cx, cy)
# Use shapely polygon to compute expected orientation
sg_poly = sg.Polygon([(ax, ay), (bx, by), (cx, cy), (ax, ay)])
if sg_poly.area == 0:
expected = 0
else:
expected = 1 if sg_poly.exterior.is_ccw else -1
> assert result == expected
E assert 0 == 1
E +0
E -1
spatialpandas/tests/geometry/algorithms/test_orientation.py:21: AssertionError
---------------------------------- Hypothesis ----------------------------------
Falsifying example: test_triangle_orientation(
ax=0.0,
ay=-4.440892098500627e-13,
bx=6.661338147750941e-13,
by=2.2204460492503136e-13,
cx=4.440892098500627e-13,
cy=0.0,
)
You can reproduce this example by temporarily adding @reproduce_failure('6.1.1', b'AXicY2CAAEYIxQTlMqMKw8UZAAEIAAo=') as a decorator on your test case
jbednar
Metadata
Metadata
Assignees
Labels
No labels