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

Method test_class_or_function_idval

testing/python/metafunc.py:354–366  ·  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

352 assert _idval(val, "a", 6, idfn=None, nodeid=None, config=None) == expected
353
354 def test_class_or_function_idval(self) -> None:
355 """Unit test for the expected behavior to obtain ids for parametrized
356 values that are classes or functions: their __name__."""
357
358 class TestClass:
359 pass
360
361 def test_function():
362 pass
363
364 values = [(TestClass, "TestClass"), (test_function, "test_function")]
365 for val, expected in values:
366 assert _idval(val, "a", 6, None, nodeid=None, config=None) == expected
367
368 def test_notset_idval(self) -> None:
369 """Test that a NOTSET value (used by an empty parameterset) generates

Callers

nothing calls this directly

Calls 1

_idvalFunction · 0.90

Tested by

no test coverage detected