def test_function_item_obj_is_instance(pytester: Pytester) -> None:
    """item.obj should be a bound method on unittest.TestCase function items (#5390)."""
    pytester.makeconftest(
        """
        def pytest_runtest_makereport(item, call):
            if call.when == 'call':
                class_ = item.parent.obj
                assert isinstance(item.obj.__self__, class_)
    """
    )
    pytester.makepyfile(
        """
        import unittest

        class Test(unittest.TestCase):
            def test_foo(self):
                pass
    """
    )
    result = pytester.runpytest_inprocess()
    result.stdout.fnmatch_lines(["* 1 passed in*"])
item.obj should be a bound method on unittest.TestCase function items (#5390).
testing/test_unittest.py