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
3 жыл бұрын
This and the 101 video are a great introduction to pytest, thank you very much for making them available!
@palmsprings1628
4 жыл бұрын
Your 101 and 201 video helped me a lot. Thank you for sharing this.
@MattLayman
4 жыл бұрын
Glad it helped!
@santhisenanajithsanthisenan
4 жыл бұрын
Great talks on pytest. Enjoyed both pytest 101 and pytest 201 very much.
@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.
@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
3 жыл бұрын
Awesome! I'm glad it helped.
@martinjohnpeck
4 жыл бұрын
Nice talk! Thanks for posting it!
@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
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
4 жыл бұрын
@@MattLayman Amazing, yep that all makes sense:). Cheers for the detailed reply!
@rodericktung264
3 жыл бұрын
Great video for pytest beginners!!
@deekshajain9369
2 жыл бұрын
Great tutorial!!
@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
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.
@QaAutomationAlchemist
3 жыл бұрын
Thanks a lot ! Should I expect future session on Hooks? !
@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.
@imanhpr
4 жыл бұрын
very useful information. i really appreciated
@sebastianwardana1527
Жыл бұрын
omg... dont get me started on nesting functions... i havent done that in ages...
@sebastianwardana1527
Жыл бұрын
-.- why is everything college or university... now im saying it too...
Пікірлер: 25