Also i had to import random package directly to make it work, but in your examples there is no such import. Maybe we use different pythons(3.10 here), but if it is not a case you may want to correct that in your example :)
thank you. Testing is the part of my learning journey that I wanted to tackle next, so this series was timely. And the missing import was pretty easy to figure out, but I didn't know enough about Pytest to know why I was getting an error about fixture being applied more than once to the same function
Also i had to import random package directly to make it work, but in your examples there is no such import. Maybe we use different pythons(3.10 here), but if it is not a case you may want to correct that in your example :)
Great read as always.
Thanks. I need a button for people pushing directly fixes to the article, like a github PR :)
This way I can say it's not that I mess up, it's that I'm encouraging contribution!
Like "solve this puzzle", not like "I forgot". Very pedagogical :)
HI BiteCode, great article as always :)
I think there is a typo with your last example. The fixture "random_number" must be an argument of the function and not the decorator.
thank you. Testing is the part of my learning journey that I wanted to tackle next, so this series was timely. And the missing import was pretty easy to figure out, but I didn't know enough about Pytest to know why I was getting an error about fixture being applied more than once to the same function
Do you mean an another consequence of an error in the article or the fact your used @pytest.fixture on 2 functions with the same name?
Thanks !
you are welcome :)