Fix unittest DeprecationWarnings#2089
Conversation
|
Aside: I think most uses of I think the changes make sense, but I'll let someone else have a glance at it. The tests are running now. |
|
Test results for commit fdc22f7 merged into master
Not available for testing: python2.6 |
|
This one have a merge conflict... |
|
Okay, rebased and removed any modifications to quarantine / deathrow. |
|
I think I got most of the deprecated methods in this pull request, but there might be a few missing still. In particular there are a bunch of calls to |
|
I may be missing something, but why did you leave them alone in test_run? |
|
Well, I wasn't sure what Update: I see now that
|
|
There are only a few tt.assert_foo (test_run and test_magic), and tt.assert_foo is nt.assert_foo. I would suggest changing those calls to use the real nt.assert_foo, and remove this whole block. |
|
@minrk Thanks for doing the research. I've removed that block of code and replaced |
|
(Note this now has a conflict, so it will need a quick rebase) |
|
Rebased & force pushed.
|
|
Test results for commit 07ea078 merged into master
Not available for testing: python2.6 |
|
Test results for commit 07ea078 merged into master
Not available for testing: python3.1 |
|
I've done a quick scan through (as of 3ac8c33) to check that there's nothing odd lurking in that big diff. I see Min's tests include Python 2.6, so I'm happy for this to go in now. |
|
+1 to merge, thanks! |
Fix unittest DeprecationWarnings
|
Merged this one. |
…rnings Fix unittest DeprecationWarnings
Several
unittest.TestCasemethods were deprecated in Python 2.7.I've attempted to normalize our tests to the currently approved methods:
assert_->assertTrueassertEquals->assertEqualassertNotEquals->assertNotEqualIn addition, this impacts
nose.toolswhich generates some methods automatically:nt.assert_equals->nt.assert_equalnt.assert_not_equals->nt.assert_not_equalThese fixes, while seemingly minor, really cut down on the verbosity of the output when running iptest with
PYTHONWARNINGS=din Python 3.2.I've done a little testing in Python 2.7 and 3.2. I haven't tested Python 2.6, but I believe all of these aliases were available in that release.