MCPcopy Create free account
hub / github.com/pytest-dev/pytest / test_setup_at_classlevel

Method test_setup_at_classlevel

testing/python/fixtures.py:1825–1840  ·  view source on GitHub ↗
(self, pytester: Pytester)

Source from the content-addressed store, hash-verified

1823 reprec.assertoutcome(passed=2)
1824
1825 def test_setup_at_classlevel(self, pytester: Pytester) -> None:
1826 pytester.makepyfile(
1827 """
1828 import pytest
1829 class TestClass(object):
1830 @pytest.fixture(autouse=True)
1831 def permethod(self, request):
1832 request.instance.funcname = request.function.__name__
1833 def test_method1(self):
1834 assert self.funcname == "test_method1"
1835 def test_method2(self):
1836 assert self.funcname == "test_method2"
1837 """
1838 )
1839 reprec = pytester.inline_run("-s")
1840 reprec.assertoutcome(passed=2)
1841
1842 @pytest.mark.xfail(reason="'enabled' feature not implemented")
1843 def test_setup_enabled_functionnode(self, pytester: Pytester) -> None:

Callers

nothing calls this directly

Calls 3

assertoutcomeMethod · 0.80
makepyfileMethod · 0.45
inline_runMethod · 0.45

Tested by

no test coverage detected