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

Method test_function_originalname

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

Source from the content-addressed store, hash-verified

682 result.stdout.fnmatch_lines(["* 3 passed in *"])
683
684 def test_function_originalname(self, pytester: Pytester) -> None:
685 items = pytester.getitems(
686 """
687 import pytest
688
689 @pytest.mark.parametrize('arg', [1,2])
690 def test_func(arg):
691 pass
692
693 def test_no_param():
694 pass
695 """
696 )
697 originalnames = []
698 for x in items:
699 assert isinstance(x, pytest.Function)
700 originalnames.append(x.originalname)
701 assert originalnames == [
702 "test_func",
703 "test_func",
704 "test_no_param",
705 ]
706
707 def test_function_with_square_brackets(self, pytester: Pytester) -> None:
708 """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