getting started with pytest (beginner - intermediate) anthony explains #518

getting started with pytest (beginner - intermediate) anthony explains #518

anthonywritescode

1 год назад

52,921 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

Diego Bonaventura
Diego Bonaventura - 27.06.2023 20:34

whats with the keyboard view?

Ответить
yomajo
yomajo - 30.04.2023 14:02

flask app is dockerized. Uses rq worker, redis, postgres as compose services. How should one thing about testing such application?

Ответить
John WT
John WT - 12.02.2023 06:08

I never knew there was a name to call how you name your variables:
camelCase
snake_case
PascalCase
kebab-case

Ответить
Sooraj H
Sooraj H - 10.02.2023 11:48

great video, do u have any idea on best way to configure test data for different environments (dev, staging etc) in pytest?

Ответить
Cal Jacobson
Cal Jacobson - 09.02.2023 04:25

How does the "you forgot to activate ./venv -- I gotchu" work?! I need that in my life 😂

Ответить
Jakub Červinka
Jakub Červinka - 25.01.2023 20:39

I've heard about this great tool, pre-commit. It's from this really cool guy, you should definitely give it a try *wink*.
It would be nice to have a "getting started with pre-commit".

Ответить
Rey Janson
Rey Janson - 24.01.2023 20:26

Awesome video! can we also have a video on Mock, patching, monkey patch..etc please!

Ответить
Damian Zaręba
Damian Zaręba - 24.01.2023 11:45

Great video!
I've quickly tested some time ago unittest from python and I found out that writing assertion keyword is not strictly prohibited, maaaaybeee they changed something? I don't know. But pytest is by far most useful 3rd party tool downloadable from PIP! Thanks for sharing this tutorial!

Ответить
Wouter Wijsman
Wouter Wijsman - 24.01.2023 11:08

I honestly prefer unittest. It is just nice to have it integrated in the language. Other than that I don't use it very differently from how you use pytest in this video.

Ответить
Alexander Rodionov
Alexander Rodionov - 24.01.2023 10:08

Thanks for the video! Many of your repos have testing directory, what do you store there? A code that is related for tests but you keep it separate because tests directory should contain only tests? Or my guess is wrong

Ответить
Elena Romanova
Elena Romanova - 24.01.2023 06:22

Thanks!

Ответить
The Endless River
The Endless River - 24.01.2023 05:54

-v{1,3} is also very helpful when tests with a more complex comparison fail, e.g. long strings, lists/tuples/dicts with many items. It shows you exactly where the difference occurred, what item is missing etc.
It helps me a lot breaking this down

Ответить
Nico Neumann
Nico Neumann - 24.01.2023 03:55

Thanks for the video!
It would be helpful to get a more advanced follow up video about fixtures, patches and so on :)

Ответить
gary thompson
gary thompson - 24.01.2023 02:19

Nice video, just checked I was sure unit test wasn’t in Python 1. Python predates junit by about 7 years and unit test was inspired by junit. python
20 February 1991. JUnit was born on a flight from Zurich to the 1997 OOPSLA in Atlanta.

Ответить
Preocts
Preocts - 24.01.2023 00:47

TIL about -s for print debugging an incorrectly passing test. I've normally just gone with the tried and true 1 / 0 in the test if it comes to that. haha

The plugins certainly make the tool shine brighter than it already does. Off the top of my head, pytest-randomly and pytest-repeat are two I use regularly to shake out and expose tricky pollution.

Ответить
ِ
ِ - 23.01.2023 23:44

Why all files of pyupgrade starts with _?

Ответить
Stanislav Schmidt
Stanislav Schmidt - 23.01.2023 22:49

Didn't know that including __init__.py would resolve name collisions - thanks!

Ответить
David Dellsperger
David Dellsperger - 23.01.2023 21:11

I assume the `-s` and suppression of I/O extends to the code not only in the test file (t_test.py) but also the original file (t.py)?

Ответить
Jakub Červinka
Jakub Červinka - 23.01.2023 21:06

One of the top python packages! 🙂

Ответить
physbuzz
physbuzz - 23.01.2023 19:01

😁

Ответить