Class (can be None) where the test function was collected.
(self)
| 525 | |
| 526 | @property |
| 527 | def cls(self): |
| 528 | """Class (can be None) where the test function was collected.""" |
| 529 | if self.scope not in ("class", "function"): |
| 530 | raise AttributeError(f"cls not available in {self.scope}-scoped context") |
| 531 | clscol = self._pyfuncitem.getparent(_pytest.python.Class) |
| 532 | if clscol: |
| 533 | return clscol.obj |
| 534 | |
| 535 | @property |
| 536 | def instance(self): |