Uh oh!
There was an error while loading. Please reload this page.
Specific asserts - #205
Conversation
Also makes use of 'self.assertIsSubclass' and 'self.assertNotIsSubclass' rather than 'assert issubclass' and 'assert not issubclass'
s/assert isinstance/self.assertIsInstance/ s/assert not isinstance/self.assertNotIsInstance/
gvanrossum
commented
Apr 18, 2016
I would actually prefer going the other way -- change the remaining Does anyone routinely run the stdlib tests with -O? |
zware
commented
Apr 18, 2016
via email
Does anyone routinely run the stdlib tests with -O? Not that I know of currently, but I would like for there to be buildbots
running with both -O and -OO, which should be easily doable if I rewrite
the build master as I recently mentioned on python-dev. |
| class TestCase(_TestCase): | ||
| # vanilla TestCase doesn't have assert*Subclass, see bugs.python.org/14819 |
There was a problem hiding this comment.
Looks like it's not going to happen any time soon. I propose not to count on it. The rename dance TestCase -> _TestCase feels kind of awkward -- why not just pick a decent new name for TestCase + assert[Not]IsSubclass, and use that where it's needed.
There was a problem hiding this comment.
Right, the comment was not meant to imply that assertIsSubclass would eventually be a standard feature. The rename dance was an effort to avoid churn, but as you pointed out, the whole PR is pretty much churn so I'll just change it to BaseTestCase.
gvanrossum
commented
Apr 19, 2016
OK, I concede your point (even though I don't like noisy commits -- you will end up owning all those lines in hg/git blame forever). Once this is merged here, can you take care of merging it into 3.5+3.6? |
zware
commented
Apr 19, 2016
My ownership of the lines is unfortunate, agreed. Yes, I can sync |
bintoro
commented
Apr 19, 2016
Note that, once #136 is resolved, most |
gvanrossum
commented
Apr 19, 2016
OK, go ahead and merge into CPython 3.5 and 3.6. |
zware
commented
Apr 19, 2016
Thanks, Guido. I've merged into cpython 3.5 and default. The only remaining question is whether you want |
gvanrossum
commented
Apr 19, 2016
Yea, please do the python2/test_typing.py -- I do try to keep them in sync. And there are plenty of PRs coming up. |
This PR converts the tests from simple
assertstatements toTestCase.assert*calls. This ensures that the tests actually test something even if Python is run with -O, and makes the tests fit the style of the rest of the standard library tests.Most of the changes were made by simple
s/assert .../self.assert.../replacements, with a few manual touchups.