Conversation
|
@pelson did you suggest there may be specific problems with this? |
|
It looks a trifle over-engineered...? |
Agreed. It was really just for testing that I discovered it was handy to make it configurable. The extra stuff should certainly all be removed once it has been 'deprecated' for a while and we switch to 'disallow'.
What would you prefer right now? |
Personally I'd go for option one - "reduce to the minimum". |
: test included
|
You might question my use of warnings.catch_warnings, as it is apparently not thread-safe ? If you think this is plainly unwise, I could probably use Mock instead ? |
lib/iris/tests/test_cdm.py
Outdated
There was a problem hiding this comment.
I prefer:
with warnings.catch_warnings():
warnings.simplefilter("error")
with self.assertRaises(DeprecationWarning):
for subcube in cube:
passas it is standalone (it does not create cube_iterator for use by later test code) and it's a little clearer (to me at least) than the generator expression. It's still not thread, but I can live with that.
There was a problem hiding this comment.
Indeed that is much neater @esc24 -- really rather lovely!
I am still tempted to use subcubes = list(cube) for the iter test expression, but maybe that is not obvious enough?
: clearer test code : don't use DeprecationWarning
|
Improved by @esc24 suggestion. |
|
I think the testcode is now simpler+clearer. |
I don't think we need to worry about it. We run the tests in a single-threaded mode. Even nosetests uses multiple processes, not threads. |
lib/iris/cube.py
Outdated
There was a problem hiding this comment.
Docstring is not needed IMHO, a single comment would suffice.
There was a problem hiding this comment.
Changing to a comment would also fix the missing blank line from the docstring. ;-)
|
Thanks - good to go. :-) |
Addresses #86
For now:
Future Intentions: