#NEWLINE# def test_collect_custom_nodes_multi_id( self , testdir ) : #NEWLINE# #INDENT# p = testdir . makepyfile ( 'def test_func(): pass' ) #NEWLINE# testdir . makeconftest ( ( '\n            import pytest\n            class SpecialItem(pytest.Item):\n                def runtest(self):\n                    return # ok\n            class SpecialFile(pytest.File):\n                def collect(self):\n                    return [SpecialItem(name="check", parent=self)]\n            def pytest_collect_file(path, parent):\n                if path.basename == %r:\n                    return SpecialFile(fspath=path, parent=parent)\n        ' % p . basename ) ) #NEWLINE# id = p . basename #NEWLINE# ( items , hookrec ) = testdir . inline_genitems ( id ) #NEWLINE# py . std . pprint . pprint ( hookrec . calls ) #NEWLINE# assert ( len ( items ) == 2 ) #NEWLINE# hookrec . assert_contains ( [ ( 'pytest_collectstart' , 'collector.fspath == collector.session.fspath' ) , ( 'pytest_collectstart' , "collector.__class__.__name__ == 'SpecialFile'" ) , ( 'pytest_collectstart' , "collector.__class__.__name__ == 'Module'" ) , ( 'pytest_pycollect_makeitem' , "name == 'test_func'" ) , ( 'pytest_collectreport' , 'report.nodeid.startswith(p.basename)' ) ] )