Return the attribute from the given object to be used as a setup/teardown xunit-style function, but only if not marked as a fixture to avoid calling it twice.
(obj: object, names: Iterable[str])
| 770 | |
| 771 | |
| 772 | def _get_first_non_fixture_func(obj: object, names: Iterable[str]) -> Optional[object]: |
| 773 | """Return the attribute from the given object to be used as a setup/teardown |
| 774 | xunit-style function, but only if not marked as a fixture to avoid calling it twice.""" |
| 775 | for name in names: |
| 776 | meth: Optional[object] = getattr(obj, name, None) |
| 777 | if meth is not None and fixtures.getfixturemarker(meth) is None: |
| 778 | return meth |
| 779 | return None |
| 780 | |
| 781 | |
| 782 | class Class(PyCollector): |
no outgoing calls
no test coverage detected