#NEWLINE# def test_canonical_import( self , monkeypatch ) : #NEWLINE# #INDENT# mod = py . std . types . ModuleType ( 'pytest_xyz' ) #NEWLINE# monkeypatch . setitem ( py . std . sys . modules , 'pytest_xyz' , mod ) #NEWLINE# pm = PytestPluginManager ( ) #NEWLINE# pm . import_plugin ( 'pytest_xyz' ) #NEWLINE# assert ( pm . get_plugin ( 'pytest_xyz' ) == mod ) #NEWLINE# assert pm . is_registered ( mod )