Updated: [rhinstaller/blivet/pulls/133 master] Fix tests deprecation warnings in a backward compatible way

atodorov installerbot-noreply at redhat.com
Wed May 27 12:22:35 UTC 2015


>From the original review in PR #120

@mulkieran
> Please use "with self.assertRaises" everywhere. It's just easier on the eyes.

This doesn't work b/c assertRaises and assertRaisesRegex are different. I'm not quite sure what do you mean but directly changing one for the other doesn't seem to work.

> Also, we always use six.PY2 and six.PY3 to check the python version for this kind of thing, not sys.version_info, so it's probably best to stick with that.

Fixed.

> I think you should be able to avoid modifying the class hierarchy to deal with the versioning problem in commit 3. You might consider modifying unittest.TestCase instead, for example.

Let me see how can I do this. Is there a place where I can hook into before the test cases are actually executed? If so I can monkey-patch unittest.TestCase instead of creating another base class.
-- 
To view this pull request on github, visit https://github.com/rhinstaller/blivet/pull/133


More information about the anaconda-patches mailing list