#NEWLINE# def test_collectignore_exclude_on_option( self , testdir ) : #NEWLINE# #INDENT# testdir . makeconftest ( '\n            collect_ignore = [\'hello\', \'test_world.py\']\n            def pytest_addoption(parser):\n                parser.addoption("--XX", action="store_true", default=False)\n            def pytest_configure(config):\n                if config.getvalue("XX"):\n                    collect_ignore[:] = []\n        ' ) #NEWLINE# testdir . mkdir ( 'hello' ) #NEWLINE# testdir . makepyfile ( test_world = 'def test_hello(): pass' ) #NEWLINE# result = testdir . runpytest ( ) #NEWLINE# assert ( result . ret == EXIT_NOTESTSCOLLECTED ) #NEWLINE# assert ( 'passed' not in result . stdout . str ( ) ) #NEWLINE# result = testdir . runpytest ( '--XX' ) #NEWLINE# assert ( result . ret == 0 ) #NEWLINE# assert ( 'passed' in result . stdout . str ( ) )