MCPcopy
hub / github.com/pytest-dev/pytest / test_class_or_function_idval

Method test_class_or_function_idval

testing/python/metafunc.py:415–429  ·  view source on GitHub ↗

Unit test for the expected behavior to obtain ids for parametrized values that are classes or functions: their __name__.

(self)

Source from the content-addressed store, hash-verified

413 )
414
415 def test_class_or_function_idval(self) -> None:
416 """Unit test for the expected behavior to obtain ids for parametrized
417 values that are classes or functions: their __name__."""
418
419 class TestClass:
420 pass
421
422 def test_function():
423 pass
424
425 values = [(TestClass, "TestClass"), (test_function, "test_function")]
426 for val, expected in values:
427 assert (
428 IdMaker([], [], None, None, None, None)._idval(val, "a", 6) == expected
429 )
430
431 def test_notset_idval(self) -> None:
432 """Test that a NOTSET value (used by an empty parameterset) generates

Callers

nothing calls this directly

Calls 2

IdMakerClass · 0.90
_idvalMethod · 0.80

Tested by

no test coverage detected