Class (can be None) where the test function was collected.
(self)
| 502 | |
| 503 | @property |
| 504 | def cls(self): |
| 505 | """Class (can be None) where the test function was collected.""" |
| 506 | if self.scope not in ("class", "function"): |
| 507 | raise AttributeError(f"cls not available in {self.scope}-scoped context") |
| 508 | clscol = self._pyfuncitem.getparent(_pytest.python.Class) |
| 509 | if clscol: |
| 510 | return clscol.obj |
| 511 | |
| 512 | @property |
| 513 | def instance(self): |