test procedure with Cython pure Python modules #6

Closed
opened 2025-10-23 12:02:06 +00:00 by foefl · 0 comments
Owner

Test coverage reporting not working properly with pure Python builds, since line tracing in inclusion in reports just happens for native .pyx files.

An alternative workflow would be:

  • delete compiled module from source tree (is imported used for tests if present)
  • run tests (now the plain Python module is used and coverage reporting works as expected)
  • install package with pdm install into environment (builds extension module via Cython)
  • run tests again (only for the relevant modules) and see if they pass (now the compiled module is used; since it is just the translated version of the pure Python module you can assume that everything works as expected and that the test coverage is equivalent to the pure Python file)
Test coverage reporting not working properly with pure Python builds, since line tracing in inclusion in reports just happens for native `.pyx` files. An alternative workflow would be: - delete compiled module from source tree (is imported used for tests if present) - run tests (now the plain Python module is used and coverage reporting works as expected) - install package with `pdm install` into environment (builds extension module via Cython) - run tests again (only for the relevant modules) and see if they pass (now the compiled module is used; since it is just the translated version of the pure Python module you can assume that everything works as expected and that the test coverage is equivalent to the pure Python file)
foefl added the
enhancement
label 2025-10-23 12:02:06 +00:00
foefl self-assigned this 2025-10-23 12:02:06 +00:00
foefl added this to the To-Dos project 2025-10-23 12:02:06 +00:00
foefl closed this issue 2025-10-24 08:48:41 +00:00
foefl moved this to Done in To-Dos on 2025-10-24 08:48:51 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: EKF-Diagnostic/sensor-anomalies#6
No description provided.