#๐ Problem with my pytest
11 messages ยท Page 1 of 1 (latest)
@little echo
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
It looks like PyTest or the test code, can't import the code unde test.
f there isn't one there already, add a file called __init__.py to the directory fonctions. The file can be empty.
What happens if you start a cmd session, activate the venv, cd to Automisationn, and run the pytest command?
ok thank you very much, it works but I don't understand on my university computer it doesn't work
I don't know how pytest works in IPython or Jupyter, it's normally run from the operating system command line.
yes okay
You're welcome. Hopefully it should just be a matter of setting the current working directory. It's best practise to install the library being tested in a test environment however (e.g. to test the actual installation and build too).
This help channel has been closed. Feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.