#๐Ÿ”’ Can't get pytest to work

13 messages ยท Page 1 of 1 (latest)

leaden furnace
#

I'm trying to learn how to use tests but I can't seem to get it to work

PS C:\Users\KARL-RICHTER\Desktop\python_work> pip install pytest
Requirement already satisfied: pytest in c:\users\karl-richter\appdata\roaming\python\python312\site-packages (8.2.2)
Requirement already satisfied: iniconfig in c:\users\karl-richter\appdata\roaming\python\python312\site-packages (from pytest) (2.0.0)
Requirement already satisfied: packaging in c:\users\karl-richter\appdata\roaming\python\python312\site-packages (from pytest) (24.1)
Requirement already satisfied: pluggy<2.0,>=1.5 in c:\users\karl-richter\appdata\roaming\python\python312\site-packages (from pytest) (1.5.0)
Requirement already satisfied: colorama in c:\users\karl-richter\appdata\roaming\python\python312\site-packages (from pytest) (0.4.6)
PS C:\Users\KARL-RICHTER\Desktop\python_work> pytest
pytest : The term 'pytest' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify 
that the path is correct and try again.
At line:1 char:1
+ pytest
+ ~~~~~~
    + CategoryInfo          : ObjectNotFound: (pytest:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException
unkempt drumBOT
#

@leaden furnace

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.

green radish
#

You probably want to install your dependencies into a virtual environment

leaden furnace
#

what does that mean ๐Ÿ˜ญ

green radish
#

What's the path to your project?

#

You can make a virtual environment with python -m venv path\to\your\project\.venv

#

Then activate it and install into that. It will add pytest to your PATH

green radish
#

@leaden furnace ^

leaden furnace
#

im gonna be honest i didnt get any of the lingo that you said so i just played around and got it to work lol

#

thank you either way

unkempt drumBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, 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.