During the sprint we discussed fixing the above issue and thought maybe it's a better idea to add a better represenation to fixtures. To do this without patching the object more, this PR refactors fixtures to have a class with attributes.
The main rational behind that is:
Now we have a type for fixtures makes it easier to check for fixture types and no need to perform cast on objects. Removed monkey patching.
They are no longer functions that carry a class within them.
When you decorate a function with a fixture it's not possible to call it anymore. So it makes more sense for it to not be a function or method.
Example
Previously we had:
===================================== short test summary info ======================================
FAILED tmp31nzhe4b.py::test_something - assert fixt == 42
======================================== 1 failed in 0.03s =========================================
where fixt is a pytest fixture function that is not replaced by it's value(directly used)
Now we print:
===================================== short test summary info ======================================
FAILED tmp31nzhe4b.py::test_something - assert pytest_fixture(<function fixt at *>) == 42
======================================== 1 failed in 0.03s =========================================
Closes #11525
During the sprint we discussed fixing the above issue and thought maybe it's a better idea to add a better represenation to fixtures. To do this without patching the object more, this PR refactors fixtures to have a class with attributes. The main rational behind that is:
Example
Previously we had:
where fixt is a pytest fixture function that is not replaced by it's value(directly used)
Now we print: