Yelp / Testify

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

Fixed get_test_method_name to report class's actual module. #194

Closed asottile closed 11 years ago

asottile commented 11 years ago

Fixes https://github.com/Yelp/Testify/issues/191

bin/testify test/test_runner_test.py
..
PASSED.  2 tests / 2 cases: 2 passed, 0 failed.  (Total test time 0.00s)
milki commented 11 years ago

lgtm

If no other concerns, will merge 10/14.

mrtyler commented 11 years ago

This looks good (yay tests!).

Before I merge (because all this class inspection metaprogramming stuff makes me anxious), can we think of any ways this might break stuff? If it did, what would those failures look like?

asottile commented 11 years ago

@mrtyler: I'm pretty sure the only time that this would blow up is if the test method on a class was an unbound method, however it'd already blow up in the same way as before.

The only actual change here is

test_method.__module__ ==> test_method.im_class.__module__
asottile commented 11 years ago

@mrtyler: Also it really only shows up when you do --list-tests

mrtyler commented 11 years ago

Merged manually (there were import conflicts with your other branch).