Running the test suite with PYTHONPATH set to . fails with multiple ModuleNotFoundError. This is an issue when packaging the software, since I'm using setuptools and do not want to install it using pip -e, etc.
$ PYTHONPATH=. pytest
============================================================================ test session starts ============================================================================
platform linux -- Python 3.6.6, pytest-3.6.3, py-1.5.4, pluggy-0.6.0
rootdir: /home/kbabioch/PKGBUILD/ansible-container-git/ansible-container, inifile:
plugins: cov-2.5.1
collected 1 item / 2 errors
================================================================================== ERRORS ===================================================================================
____________________________________________________________ ERROR collecting test/unit/container/test_config.py ____________________________________________________________
ImportError while importing test module '/home/kbabioch/PKGBUILD/ansible-container-git/ansible-container/test/unit/container/test_config.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
test/unit/container/test_config.py:9: in <module>
from container.config import AnsibleContainerConfig
container/config.py:21: in <module>
import jsonschema
E ModuleNotFoundError: No module named 'jsonschema'
_________________________________________________________ ERROR collecting test/unit/container/docker/test_utils.py _________________________________________________________
ImportError while importing test module '/home/kbabioch/PKGBUILD/ansible-container-git/ansible-container/test/unit/container/docker/test_utils.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
test/unit/container/docker/test_utils.py:8: in <module>
from container.docker.utils import which_docker, config_to_compose
E ModuleNotFoundError: No module named 'container.docker.utils'
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 2 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
========================================================================== 2 error in 0.54 seconds ==========================================================================
FAIL: 2
ISSUE TYPE
SUMMARY
Running the test suite with
PYTHONPATH
set to.
fails with multipleModuleNotFoundError
. This is an issue when packaging the software, since I'm using setuptools and do not want to install it using pip -e, etc.STEPS TO REPRODUCE
1.) Clone the repository:
2.) Try to run the test suite:
EXPECTED RESULTS
Test suite should successfully run
ACTUAL RESULTS
Several import errors: