AttributeError: 'SubRequest' object has no attribute 'param' #2162
Labels
plugin: unittest
related to the unittest integration builtin plugin
type: question
general question, might be closed after 2 weeks of inactivity
I have a code using cascaded fixtures that is the first fixture will create raw data with different parameters and the second fixtures will use the first fixture and create parameterized test cases based on the exhaustive enumeration of parameters specified in first and second.
A oversimplified version of aforementioned problem is listed below:
The cascaded fixtures work well when the test case is unbound (not bound to any TestCase instance) but not when being an instance method of a TestCase. The TestCase will complain SubRequest has no param attribute for the first fixture. I wonder what’s the logics behind SubRequest and what causes the differentiate behaviors in bound / unbound test function.
Would you be so kind as to sharing insights or tips about the pytest code design and maybe indicate which part of code I should look into in order to shed some light of this problem? Or maybe a better design to solve this problem.
Many thanks in advance.
pytest version 2.9.1
OS: Darwin Kernel Version 15.6.0: x86_64
sandbox_pip_list_output.txt
The text was updated successfully, but these errors were encountered: