Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix import statement in unit test #596

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Fix import statement in unit test #596

wants to merge 1 commit into from

Conversation

brawer
Copy link
Contributor

@brawer brawer commented Mar 10, 2020

Changed to a relative import, which it actually is. Before this change,
Python setuptools was unable to run glyphsLib unit tests on Alpine Linux.
(Alpine seems to be more strict on Python import paths?) After this change,
the unit tests get executed. They still fail, but that is another problem.

Here’s the traceback of the error before this change:

run_various_tests_on_various_files (unittest.loader._FailedTest) ... ERROR

======================================================================
ERROR: run_various_tests_on_various_files (unittest.loader._FailedTest)
----------------------------------------------------------------------
ImportError: Failed to import test module: run_various_tests_on_various_files
Traceback (most recent call last):
  File "/usr/lib/python3.8/unittest/loader.py", line 154, in loadTestsFromName
    module = __import__(module_name)
  File "/home/builder/aports/testing/py3-glyphslib/src/glyphsLib-5.1.7/tests/run_various_tests_on_various_files.py", line 25, in <module>
    import test_helpers
ModuleNotFoundError: No module named 'test_helpers'

Changed to a relative import, which it actually is. Before this change,
Python setuptools was unable to run glyphsLib unit tests on Alpine Linux.
(Alpine seems to be more strict on Python import paths?) After this change,
the unit tests get executed. They still fail, but that is another problem.

Here’s the traceback of the error before this change:

```
run_various_tests_on_various_files (unittest.loader._FailedTest) ... ERROR

======================================================================
ERROR: run_various_tests_on_various_files (unittest.loader._FailedTest)
----------------------------------------------------------------------
ImportError: Failed to import test module: run_various_tests_on_various_files
Traceback (most recent call last):
  File "/usr/lib/python3.8/unittest/loader.py", line 154, in loadTestsFromName
    module = __import__(module_name)
  File "/home/builder/aports/testing/py3-glyphslib/src/glyphsLib-5.1.7/tests/run_various_tests_on_various_files.py", line 25, in <module>
    import test_helpers
ModuleNotFoundError: No module named 'test_helpers'
```
Base automatically changed from master to main February 17, 2021 12:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant