[issue10675] unittest should have an assertChanges context manager

2011-01-20 Thread Ezio Melotti
Changes by Ezio Melotti : -- components: +Tests nosy: +ezio.melotti ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscri

[issue10675] unittest should have an assertChanges context manager

2010-12-10 Thread Raymond Hettinger
Raymond Hettinger added the comment: Thanks for submitting the idea though. Perhaps, post it on the ASPN Cookbook or on the newsgroup to see if others are interested. -- ___ Python tracker

[issue10675] unittest should have an assertChanges context manager

2010-12-10 Thread Raymond Hettinger
Raymond Hettinger added the comment: I concur with David Murray. Usually you care about the specific value changed to, not whether it changed at all. The changed-by variant is even more specialized and you're better of using assertEqual since you know what the new value is supposed to be:

[issue10675] unittest should have an assertChanges context manager

2010-12-10 Thread Benjamin Peterson
Changes by Benjamin Peterson : -- status: pending -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: htt

[issue10675] unittest should have an assertChanges context manager

2010-12-10 Thread R. David Murray
R. David Murray added the comment: I think this is the kind of thing where you are *much* better off writing a specialized assert method that exactly fits your use case. There are too many variations on this theme, IMO, for it to make sense as an stdlib method. -- nosy: +michael.foor

[issue10675] unittest should have an assertChanges context manager

2010-12-10 Thread Jay Moorthi
New submission from Jay Moorthi : It would be useful to have a new assert method in the unittest.TestCase class that checks to see if a value has changed. I wrote a quick and dirty version like so: class MySpecialTestCase(unittest.TestCase): @contextmanager def assertChanges(self, thi