econ-ark / econ-ark/EstimatingMicroDSOPs

Test with pytest not working

Open
#17 1 comment 0 reactions 2 assignees Claimed by @camriddell View on GitHub
Dominant language
JavaScript
Stars
2
Forks
10
PR merge metrics
No merged PRs in 30d

Description

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.
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.