CleanCut / green

Green is a clean, colorful, fast python test runner.
MIT License
786 stars 74 forks source link

Accessing non-existent object member causes an extra error report #150

Closed CleanCut closed 7 years ago

CleanCut commented 7 years ago

Accessing any member of any object, like this:

import unittest
class Test(unittest.TestCase):
    def test_garbage(self):
        "".garbage

...for some reason produces:

$ green -vvv test
Green 2.6.0, Coverage 4.3.4, Python 2.7.13

test
  Test
E   test_garbage
green.suite
  GreenTestSuite
E   test_garbage.GreenTestSuite

Error in test.Test.test_garbage
  File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/unittest/case.py", line 329, in run
    testMethod()
  File "test.py", line 8, in test_garbage
    "".garbage
AttributeError: 'str' object has no attribute 'garbage'

Error in test.Test.test_garbage
  File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/unittest/case.py", line 329, in run
    testMethod()
  File "test.py", line 8, in test_garbage
    "".garbage
AttributeError: 'str' object has no attribute 'garbage'

Ran 2 tests in 0.113s

FAILED (errors=2)