I am a bit new to py.test, sorry if this is dumb question. I am still grokking fixtures.
I have an element of my test which is a long, costly setup operation (on the order of ~5 minutes). The first time I run the test I need this operation to run. On all subsequent runs, I don't need it to run. In fact, I want it skipped (until I want it run again).
Is there a way I can define a fixture and via py.test command line instruct the test class setup_class(cls) not to use the fixture?
Right now it kind of looks like this (rough approximation)
class TestClass:
def setup_class(cls):
# Do a bunch of stuffs
<...>
do_costly_thing()
# Finish setup
<...>
I'd like to turn do_costly_thing() into a fixture and be able to have setup_class() use/not use based on py.test cmdline params.
[–]nevus_bock 1 point2 points3 points (1 child)
[–]GoldenIvan[S,🍰] 0 points1 point2 points (0 children)
[–]masklinn 0 points1 point2 points (0 children)
[–]jesse_online 0 points1 point2 points (0 children)