CJohnston079 / obfuscator

0 stars 0 forks source link

Unit tests raise `ModuleNotFoundError` when running from `Makefile` #32

Closed CJohnston079 closed 4 months ago

CJohnston079 commented 4 months ago

Issue

When running unit-test or marked-test-<test> from Makefile, a ModuleNotFoundError is raised. This is probably due to switching to relative imports for all .py files in the src/ directory.

Proposed resolution

Suffix the PYTHONPATH variable with the working directory and src/ directory in unit test commands. PYTHONPATH=${PYTHONPATH} pytest becomes: PYTHONPATH=${PYTHONPATH}:$(WD)/src pytest.

CJohnston079 commented 4 months ago

Resolved in 91bb131fe4abafc797a63511047017a06f0babb5 with proposed resolution.