Yelp / Testify

A more pythonic testing framework.
Other
308 stars 67 forks source link

Fix empty tests list #161

Closed hithwen closed 11 years ago

hithwen commented 11 years ago

When executing test_program.TestProgram(['test', '--list-tests']) I was getting an empty list, reason was self.__name_overrides was an empty set != None

baris commented 11 years ago

I can not reproduce the issue with current master. Looks like the attribute in question should actually be set to None. Can you please add a test for the issue? We'll need the test case to merge the request in, anyway.

We currently do not have any test coverage for TestProgram, so please let me know if you have trouble adding creating a test case for this issue.

hithwen commented 11 years ago

The problem appears when using Jython and it can be reproduced with this example Running with python is ok:

$ python runner.py test.mytest MyTest.test_my_app ... fail: test.mytest MyTest.test_my_app Traceback (most recent call last): File "/private/tmp/myproj/test/mytest.py", line 6, in test_my_app assert_equals(1,2) AssertionError: assertion failed: l == r l: 1 r: 2

Diff: l: 1 r: 2

FAIL in 0.00s

FAILED. 1 test / 1 case: 0 passed, 1 failed. (Total test time 0.00s)

Same execution with jython

$ jython runner.py No tests were discovered (tests must subclass TestCase and test methods must begin with 'test'). ERROR. 0 tests / 0 cases: 0 passed, 0 failed. (Total test time 0.00s)

baris commented 11 years ago

Okay, I see. Supporting jython is not one of our highest priorities, but if you'd like to maintain compatibility I think we can include your changes. Of course, all of your changes must have tests and shouldn't break cpython support.

hithwen commented 11 years ago

Hi, Ok, I'm dropping jython too, you can close the pull request. Thanks for your time