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

Test with pytest not working #17

Open
alanlujan91 opened this issue Nov 27, 2023 · 1 comment
Open

Test with pytest not working #17

alanlujan91 opened this issue Nov 27, 2023 · 1 comment
Assignees

Comments

@alanlujan91
Copy link
Member

Any idea why this doesn't work?

Run pytest ./code/tests.py
  pytest ./code/tests.py
  shell: /usr/bin/bash -e {0}
  env:
    pythonLocation: /opt/hostedtoolcache/Python/3.9.18/x64
    LD_LIBRARY_PATH: /opt/hostedtoolcache/Python/3.9.18/x64/lib
============================= test session starts ==============================
platform linux -- Python 3.9.18, pytest-7.4.3, pluggy-1.3.0
rootdir: /home/runner/work/SolvingMicroDSOPs-LifeCycle/SolvingMicroDSOPs-LifeCycle
collected 0 items / 1 error

==================================== ERRORS ====================================
________________________ ERROR collecting code/tests.py ________________________
ImportError while importing test module '/home/runner/work/SolvingMicroDSOPs-LifeCycle/SolvingMicroDSOPs-LifeCycle/code/tests.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/opt/hostedtoolcache/Python/3.9.18/x64/lib/python3.9/importlib/__init__.py:1[2](https://github.com/econ-ark/SolvingMicroDSOPs-LifeCycle/actions/runs/7010871614/job/19072314000#step:5:2)7: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
E   ModuleNotFoundError: No module named 'code.tests'; 'code' is not a package
=========================== short test summary info ============================
ERROR code/tests.py
!!!!!!!!!!!!!!!!!!!! Interrupted: 1 error during collection !!!!!!!!!!!!!!!!!!!!
=============================== 1 error in 0.0[6](https://github.com/econ-ark/SolvingMicroDSOPs-LifeCycle/actions/runs/7010871614/job/19072314000#step:5:6)s ===============================
Error: Process completed with exit code 2.
@alanlujan91
Copy link
Member Author

Tests run fine locally

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

3 participants