use setup_class instead of setUp#735
Merged
pganssle merged 1 commit intodateutil:masterfrom Feb 26, 2019
Merged
Conversation
Member
|
@jbrockmendel Sorry, I let this sit unreviewed for too long and now it's got some serious merge conflicts. Do you want to resolve them or should I? |
Contributor
Author
|
I'm happy to resolve them, but it'll be a few days before I can get around to it. |
Member
|
No rush. |
b3fe75b to
bead8bf
Compare
bead8bf to
0d2c4e1
Compare
Contributor
Author
|
This should be ready. I've identified some more test cleanups to do in another pass, will wait until this is merged. |
pganssle
approved these changes
Feb 26, 2019
|
|
||
|
|
||
| class TestFormat(unittest.TestCase): | ||
| class TestFormat(object): |
Member
There was a problem hiding this comment.
I've been writing so much Python 3 lately that I was initially taken aback by this. Sooooooon.
Member
|
Gah, forgot a news entry. No need to make a separate PR for it considering it's an internal refactoring, I'll just do it later. |
pganssle
added a commit
to jbrockmendel/dateutil
that referenced
this pull request
Feb 26, 2019
This is merged in the branch for PR dateutil#882 because PR dateutil#735 was accidentally merged without a changelog.
Merged
This was referenced Mar 11, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Most of the parser tests are written with the older unittest structure. Now that we're using pytest, some of that can be cleaned up.
The only substantive change is using a classmethod
setup_classinstead of a regular methodsetUp, so it only gets called once instead of for each test. Small-n it looks like this saves 20-30% of the runtime for that file (which is only 3-5 seconds, so really not a big deal).There are a lot of
self.assertEqualstatements so getting them all will take a few passes.