MCPcopy Index your code
hub / github.com/pytest-dev/pytest / test_function_originalname

Method test_function_originalname

testing/python/collect.py:788–809  ·  view source on GitHub ↗
(self, pytester: Pytester)

Source from the content-addressed store, hash-verified

786 result.stdout.fnmatch_lines(["* 3 passed in *"])
787
788 def test_function_originalname(self, pytester: Pytester) -> None:
789 items = pytester.getitems(
790 """
791 import pytest
792
793 @pytest.mark.parametrize('arg', [1,2])
794 def test_func(arg):
795 pass
796
797 def test_no_param():
798 pass
799 """
800 )
801 originalnames = []
802 for x in items:
803 assert isinstance(x, pytest.Function)
804 originalnames.append(x.originalname)
805 assert originalnames == [
806 "test_func",
807 "test_func",
808 "test_no_param",
809 ]
810
811 def test_function_with_square_brackets(self, pytester: Pytester) -> None:
812 """Check that functions with square brackets don't cause trouble."""

Callers

nothing calls this directly

Calls 2

appendMethod · 0.80
getitemsMethod · 0.45

Tested by

no test coverage detected