Setting up unit tests in Python with VSCode

preview_player
Показать описание
Using macOS Catalina Version 10.15.7
Using VS Code Version: 1.53.0

Рекомендации по теме
Комментарии
Автор

1:34 I don't have the option "Run current test file". At that place I have the option "run current file in interactive window".

felixmerz
Автор

WINDOWS USERS: What this channel got wrong is, you actually DO need to run "pip install pytest" in powershell for the GUI to start working, as for getting pip working (considering a clean install here) you should just click the first link when searching "how to install pip", just make sure you run the Windows commands, by default it shows Linux. And also the other 2 pre-rquisites of installing python on your PC and and the Python extension in VSCode.
Both him and my Mac user teacher who's the reason I'm even browsing this on youtube got this wrong.

madeformario
Автор

For the love of me i cant seem to get the tests to appear. when i do: python3 -m unittest discover -v -s . -p "*test*.py" i can see them but the UI is just hanging. I have a venv and ive set the tests to be on that could this be the issue? I also dont have the option to run current test file when i right click

helikopter
Автор

Every time I try to config testing, and I set the options it just doesn't save them or something so it doesn't work

alextonev
Автор

The issue many people face is the one you removed by taking away the external file. VS Code doesn't seem to autoreload modules after changing them. So, we have to reload the window or some of mechanism. How do you get around this?

timrohrer
Автор

thank you SO MUCH. this helped me immensely.

BookGirl
Автор

Did they remove the Run test Debug test on the file?

guled
Автор

Very straight forward and helpful video, thanks! 😊👍

FABESTAH
Автор

Is there a way to generate a test report using this method?

LilianaGonzalez-shdc
Автор

I am getting error "No tests ran, please check the configuration settings for", please help how to fix it.

mihirkumarsrivastava