I have a unit test file:
import unittest
from geo.geo2d.points.Point2d import Point2d
from geo.geo2d.shapes.Polygon2d import Polygon2d
class TestPolygon2d(unittest.TestCase):
"""
Tests Polygon2d.
"""
def test_is_convex_vertex(self):
# concave polygon
vertices = [Point2d(0, 0), Point2d(5, 0), Point2d(5, 5), Point2d(2.5, 2.5), Point2d(0, 5)]
polygon = Polygon2d(vertices)
v0_convexity = polygon.is_convex_vertex(0)
self.assertTrue(v0_convexity)
v3_convexity = polygon.is_convex_vertex(3)
self.assertFalse(v3_convexity)
if __name__ == '__main__':
unittest.main()
Using PyCharm 2024.2 if I place a break point at the line starting “v0_convexity” I can then step into the function call using the down arrow. However, if I move the break-point to the line “v3_convexity” and again attempt to step into the call it simply steps over the function call.
If I then comment out the 2 lines associated with “v0_convexity” I can then step into the “v3_convexity” function call.
Has anyone else seen this?
It’s as though after the first use of the Polygon2d class that something needs to be flushed so that I can step into the function call with the debugger.
The strange thing is that the unit test will pass with both function calls, and just that I can’t use the debugger to step into the code as expected.