how to handle acyclic pattern for test case generation? #11185
Replies: 3 comments 5 replies
-
the example is absolutely unclear as to what the desired use case and behaviour is to anyone lackaing the background knowledge of your particular problem domain please elaborate what cases are and how they are supposed to interact |
Beta Was this translation helpful? Give feedback.
-
Thank you taking a look. I will try to explain. . The application code deals with generating json that would be finally be rendered as webpage by browser runtime. The application code is required to find the changed diff and report to the frontend browser. There are 3 class type "passive", "active" and "mutable". Unlike mutable, Passive/active never change. The classesare further classified bases on containment property: which is "none", static, "mutable". None implies it class does not act as container. Static implies contains only static objects. "mutable" implies it can contain both static and mutable objects. All this class generation is for efficiently retrieving changed diff. So, in the test: fixture Finally, I am creating tests that take two filtering fixtures: one for container class types, and another non-container and creates instances and tests operations on those instances. my guess is that since pytest is iterator based, the fixture exhausts all the cases generated from all_cases, resulting is second fixture to have none of the cases. I don't have to stick to this pattern of test setup. I am open using other patterns that would address this issue. |
Beta Was this translation helpful? Give feedback.
-
Was able to solve this. Essentially, I shouldn't be using fixtures to create parameters. The new approach looks as follows:
Maybe there is some value in having fixture like expression for parameter generation . They fixture-style expressions are much cleaner and succient. Thanks for chiming in the discussion. It helped. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Best, I can explain this with example.
there are no cases in subcases_2 and hence there are no test to run in test_x. My usage is bit involved with subcases of subcases and that tree going a bit deep. Any ideas would be of great help. Thanks.
Beta Was this translation helpful? Give feedback.
All reactions