python-intermediate-development icon indicating copy to clipboard operation
python-intermediate-development copied to clipboard

running pytest for test_models.py fails

Open bioinfwithjudith opened this issue 2 years ago • 2 comments

Running pytest tests/test_models.py from python-intermediate-inflammation directory fails and raises a ModuleNotFoundError: No module named 'inflammation' error

I have tried to run it from the inflammation directory but it still doesn't work. I don't know where to go from here. Below I share the link of where I am stuck in the course.

https://carpentries-incubator.github.io/python-intermediate-development/21-automatically-testing-software/index.html

bioinfwithjudith avatar Nov 14 '22 15:11 bioinfwithjudith

Following a Stack overflow post https://stackoverflow.com/questions/20971619/ensuring-py-test-includes-the-application-directory-in-sys-path I got around this issue by running python3 -m pytest tests/test_models.py instead!

bioinfwithjudith avatar Nov 22 '22 20:11 bioinfwithjudith

I'm going to have to untag myself as I'm currently very overworked, apologies. Will email Aleks about the situation later.

smangham avatar Oct 17 '23 10:10 smangham

We run the tests with python3 -m pytest tests/... in the course material so this hopefully won't happen.

anenadic avatar May 22 '24 10:05 anenadic