Тёмный

Python Testing 201 with pytest 

Matt Layman
Подписаться 6 тыс.
Просмотров 22 тыс.
50% 1

Опубликовано:

 

24 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 25   
@1cannon3
@1cannon3 4 года назад
9:27 Testing exceptions/errors 13:20 Parametrize 24:08 Fixtures 28:10 Built-in pytest fixtures
@stabbler
@stabbler 5 лет назад
Wow.. I just watched your 101 and I was wondering about this one and voilà!.. Thx Matt for these greats contents. Keep up with the good work!
@oscarmvl
@oscarmvl 3 года назад
This and the 101 video are a great introduction to pytest, thank you very much for making them available!
@tjflynn1014
@tjflynn1014 4 года назад
In regards to fixtures, I think it would have been useful to see an example in which your custom fixture actually yields. This way you could show setup and teardown scenarios similar to what unittest does.
@palmsprings1628
@palmsprings1628 4 года назад
Your 101 and 201 video helped me a lot. Thank you for sharing this.
@MattLayman
@MattLayman 4 года назад
Glad it helped!
@santhisenanajithsanthisenan
@santhisenanajithsanthisenan 4 года назад
Great talks on pytest. Enjoyed both pytest 101 and pytest 201 very much.
@simonsteiner4743
@simonsteiner4743 3 года назад
as a physics undergrad this really helps me in my coding courses cause they threw us in cold water with that stuff! Thanks and cheers from austria aka Vienna != Austria hehe
@MattLayman
@MattLayman 3 года назад
Awesome! I'm glad it helped.
@martinjohnpeck
@martinjohnpeck 4 года назад
Nice talk! Thanks for posting it!
@robmckiernan3264
@robmckiernan3264 4 года назад
Hi Matt, thanks so much for these videos, they're a really good primer! I've got a couple of questions if you've got a moment or two: Are the fixtures the only arguments that test functions would ever take? If there are other arguments, then on what basis does pytest distinguish between the fixture arguments and the non-fixture arguments? You mentioned that you can have multiple files that store your fixtures at 26:38. How does pytest look for these files? E.g. Is there naming convention? Thanks again!
@MattLayman
@MattLayman 4 года назад
Most test functions won't take any arguments so this usually isn't an issue. That being said, there are a couple of cases that pytest can handle. 1. If you have test classes with test methods, pytest will ignore the self parameter. 2. If you are using mock.patch as a decorator, the mocked object will be the first argument. pytest will happily ignore it and fixtures can coexist with the mocked parameter. 3. If it's not either of those cases and you typo the name of the fixture, pytest will complain saying it can't find the fixture. For multiple fixture files, pytest looks for files named conftest.py. The root conftest.py are fixtures that are available across the entire suite. If you want fixtures that are only scoped to a certain package, then you can put a conftest.py in that package. The fixtures in that package will only be available to that package (and any sub-packages). I hope that makes sense. Thanks for the questions!
@robmckiernan3264
@robmckiernan3264 4 года назад
@@MattLayman Amazing, yep that all makes sense:). Cheers for the detailed reply!
@QaAutomationAlchemist
@QaAutomationAlchemist 3 года назад
Thanks a lot ! Should I expect future session on Hooks? !
@MattLayman
@MattLayman 3 года назад
That's an interesting suggestion, thanks. It's not in plan currently, but if I do another pytest video, that seems like a good topic to cover.
@im18already
@im18already 4 года назад
Thanks for sharing. It is really useful. I'm just curious, if I have a method that relies on API to get the json data then run its computation. Do I just store the data as a variable in the test file or is there other better option. So that I do not need to query the API for the testing.
@MattLayman
@MattLayman 4 года назад
Check out vcrpy.readthedocs.io/en/latest/index.html or betamax.readthedocs.io/en/latest/index.html. Those are tools to record API requests that can be used to avoid going to real APIs all the time.
@sebastianwardana1527
@sebastianwardana1527 Год назад
omg... dont get me started on nesting functions... i havent done that in ages...
@rodericktung264
@rodericktung264 4 года назад
Great video for pytest beginners!!
@imanhpr
@imanhpr 4 года назад
very useful information. i really appreciated
@deekshajain9369
@deekshajain9369 2 года назад
Great tutorial!!
@sebastianwardana1527
@sebastianwardana1527 Год назад
-.- why is everything college or university... now im saying it too...
Далее
Python Testing 101 with pytest
1:11:23
Просмотров 76 тыс.
ТЕСЛА КИБЕРТРАК x WYLSACOM / РАЗГОН
1:40:47
Скинь той самой ❤️‍🔥
00:15
Просмотров 17 тыс.
Automated testing with pytest and fixtures
27:17
Просмотров 25 тыс.
How to Improve Blender's UI
20:27
Просмотров 7 тыс.
What Does It Take To Be An Expert At Python?
1:52:03
Просмотров 1,7 млн
Raphael Pierzina - Advanced pytest
53:29
Просмотров 10 тыс.