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

[bug] config import test error #28

Closed
rachejazz opened this issue Jun 10, 2021 · 1 comment
Closed

[bug] config import test error #28

rachejazz opened this issue Jun 10, 2021 · 1 comment

Comments

@rachejazz
Copy link
Member

rachejazz commented Jun 10, 2021

================================================ ERRORS =================================================
_____________________________________ ERROR collecting test_json.py _____________________________________
ImportError while importing test module '/opt/software-discovery-tool/src/tests/test_json.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
test_json.py:7: in <module>
    from config.config import server_host
E   ModuleNotFoundError: No module named 'config.config'; 'config' is not a package
____________________________________ ERROR collecting test_render.py ____________________________________
ImportError while importing test module '/opt/software-discovery-tool/src/tests/test_render.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib/python3.8/importlib/__init__.py:127: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
test_render.py:6: in <module>
    from config.config import server_host
E   ModuleNotFoundError: No module named 'config.config'; 'config' is not a package
=========================================== warnings summary ============================================
../../../../home/divya/.local/lib/python3.8/site-packages/_pytest/cacheprovider.py:428
  /home/divya/.local/lib/python3.8/site-packages/_pytest/cacheprovider.py:428: PytestCacheWarning: could not create cache path /opt/software-discovery-tool/src/tests/.pytest_cache/v/cache/nodeids
    config.cache.set("cache/nodeids", sorted(self.cached_nodeids))

../../../../home/divya/.local/lib/python3.8/site-packages/_pytest/cacheprovider.py:382
  /home/divya/.local/lib/python3.8/site-packages/_pytest/cacheprovider.py:382: PytestCacheWarning: could not create cache path /opt/software-discovery-tool/src/tests/.pytest_cache/v/cache/lastfailed
    config.cache.set("cache/lastfailed", self.lastfailed)

../../../../home/divya/.local/lib/python3.8/site-packages/_pytest/stepwise.py:49
  /home/divya/.local/lib/python3.8/site-packages/_pytest/stepwise.py:49: PytestCacheWarning: could not create cache path /opt/software-discovery-tool/src/tests/.pytest_cache/v/cache/stepwise
    session.config.cache.set(STEPWISE_CACHE_DIR, [])

-- Docs: https://docs.pytest.org/en/stable/warnings.html
======================================== short test summary info ========================================
ERROR test_json.py
ERROR test_render.py
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 2 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
===================================== 3 warnings, 2 errors in 0.17s =====================================

These errors are now solved.
ENV: Both Ubuntu and SUSE
Also the warnings can be let go according to #6681 with pytest -p no:warnings
Will be wonderful if the docs and the fix is made. Once approved, I'll send a PR

@rachejazz
Copy link
Member Author

Solved by #34

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

No branches or pull requests

1 participant