#๐Ÿ”’ Problem with my pytest

11 messages ยท Page 1 of 1 (latest)

vagrant ridgeBOT
#

@little echo

Python help channel opened

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.

mighty pecan
#

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.

little echo
#

there is one

mighty pecan
#

What happens if you start a cmd session, activate the venv, cd to Automisationn, and run the pytest command?

little echo
#

ok thank you very much, it works but I don't understand on my university computer it doesn't work

mighty pecan
#

I don't know how pytest works in IPython or Jupyter, it's normally run from the operating system command line.

little echo
#

yes okay

mighty pecan
#

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

vagrant ridgeBOT
#
Python help channel closed using Discord native close action

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.