parameterized icon indicating copy to clipboard operation
parameterized copied to clipboard

Add test for test mixins

Open Saviq opened this issue 5 years ago • 1 comments
trafficstars

Hey,

This PR adds a test showcasing an issue I found when trying to abstract some tests to a common base class.

It's somewhat related to #73, the problem being that test_method2 is ran for the non-parameterized class, because its __dict__ does not contain it.

The only solution I can think of is to recursively copy the base classes while pruning them of test_ methods.

@wolever would you accept such a change? Do you think it's worth it?

Saviq avatar Dec 05 '19 17:12 Saviq

Oohh good catch! Yes, this is definitely something that would be good to fix.

I believe the best approach would be the one I've implemented here: https://github.com/wolever/parameterized/commit/0054c05ddd0158278a55c1525bb43a1770c3fb24 (as it doesn't involve mutating any external classes)

For some reason, though, this is triggering a bug in nose2 which causes the tearDownModule method to be called multiple times… and I wasn't able to figure out what's going on in the half hour I poked around at it.

I'd be extremely happy if you were able to figure out what's going on, though!

wolever avatar Apr 12 '20 21:04 wolever