Yelp / Testify

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

run all parent-class fixtures before any subclass fixtures #199

Closed blampe closed 10 years ago

blampe commented 11 years ago

Resolves #182.

Rips out fixture management/discovery into its own file, and moves tests accordingly.

The only test behavior that I modified was in test_order and test_order_with_deprecated_class_level_fixtures_in_derived_class to define the order for method-level fixtures. All other tests pass without issue.

PASSED. 261 tests / 104 cases: 261 passed, 0 failed. (Total test time 4.05s)

The meat of the change involved getting rid of the fixture state tracking we were doing in favor of with blocks. The context manager tells use which fixtures failed, and we can choose to act appropriately. There's a subtlety here, because when we're in the with block we're only aware of setup failures; outside of the block, the yielded list is mutated to include any teardown failures.

I haven't updated documentation/comments yet. I plan to do that soon.

Potentially backwards-incompatible changes

baris commented 11 years ago

This looks good to me. Please do not forget to update the documentation & comments. :)