#NEWLINE# def test_collection_error( self , testdir ) : #NEWLINE# #INDENT# p = testdir . makepyfile ( '\n            import not_exists\n        ' ) #NEWLINE# result = testdir . runpytest ( testdir ) #NEWLINE# assert ( '__import__' not in result . stdout . str ( ) ) , 'too long traceback' #NEWLINE# result . stdout . fnmatch_lines ( [ '*ERROR collecting*' , '*mport*not_exists*' ] )