def test_dont_collect_non_function_callable(testdir):
 testdir.makepyfile('\n        class Oh(object):\n            def __call__(self):\n                pass\n\n        test_a = Oh()\n\n        def test_real():\n            pass\n    ')
 result = testdir.runpytest('-rw')
 result.stdout.fnmatch_lines(['*collected 1 item*', 'WC2 *', '*1 passed, 1 pytest-warnings in *'])

def test_dont_collect_non_function_callable ( testdir ) : testdir . makepyfile ( '\n        class Oh(object):\n            def __call__(self):\n                pass\n\n        test_a = Oh()\n\n        def test_real():\n            pass\n    ' ) result = testdir . runpytest ( '-rw' ) result . stdout . fnmatch_lines ( [ '*collected 1 item*' , 'WC2 *' , '*1 passed, 1 pytest-warnings in *' ] )
test for issue URL in this case an internalerror occurred trying to report the failure of a test like this one because py test failed to get the source lines .