def test_class_injection_does_not_break_collection(testdir):
 testdir.makeconftest('\n        from test_inject import TestClass\n        def pytest_generate_tests(metafunc):\n            TestClass.changed_var = {}\n    ')
 testdir.makepyfile(test_inject='\n         class TestClass(object):\n            def test_injection(self):\n                """Test being parametrized."""\n                pass\n    ')
 result = testdir.runpytest()
 assert ('RuntimeError: dictionary changed size during iteration' not in result.stdout.str())
 result.stdout.fnmatch_lines(['*1 passed*'])

def test_class_injection_does_not_break_collection ( testdir ) : testdir . makeconftest ( '\n        from test_inject import TestClass\n        def pytest_generate_tests(metafunc):\n            TestClass.changed_var = {}\n    ' ) testdir . makepyfile ( test_inject = '\n         class TestClass(object):\n            def test_injection(self):\n                """Test being parametrized."""\n                pass\n    ' ) result = testdir . runpytest ( ) assert ( 'RuntimeError: dictionary changed size during iteration' not in result . stdout . str ( ) ) result . stdout . fnmatch_lines ( [ '*1 passed*' ] )
tests whether injection during collection time will terminate testing .