Changed assertions and fixtures#1379
Open
1rvine wants to merge 2 commits intoAcademySoftwareFoundation:mainfrom
Open
Changed assertions and fixtures#13791rvine wants to merge 2 commits intoAcademySoftwareFoundation:mainfrom
1rvine wants to merge 2 commits intoAcademySoftwareFoundation:mainfrom
Conversation
|
|
reinecke
requested changes
Aug 11, 2022
Collaborator
reinecke
left a comment
There was a problem hiding this comment.
Looks like it's coming along!
In addition to the specific notes I gave, here are some more general notes to apply broadly across the PR:
- It looks like the build failed mostly due to linting errors. Check out PEP 8 and The Black code style to get familiar with python code style guidelines.
- Simple assertions (like
assert (t.value == 0)orassert(tr.contains(tstart))) should not include the parens, they can just be written asassert t.value == 0orassert tr.contains(tstart) - Since the goal of the PR is to move from unittest to pytest, try removing the
import unittestfrom the top of the files. What errors pop up when you run the tests? Those are all things that moving to pytest's standards will help address.
tests/test_core.py
Outdated
| @@ -5,17 +5,17 @@ | |||
| import shutil | |||
| import tempfile | |||
| import unittest | |||
Collaborator
There was a problem hiding this comment.
Since this PR is aiming to switch from unittest to pytest, I'd look at the uses of unittest within this module and see if you can replace them with pytest equivalents.
One example I see is the usage of the @unittest.skipUnless decorator - this can be replaced by "inverting" the logic on the test case and using @pytest.mark.skipif instead.
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.
Link the Issue(s) this Pull Request is related to.
Each PR should link at least one issue, in the form:
This pull request was initiated as a part of a CodeDay mentorship program.
Partially addresses #1228
Use one line for each Issue. This allows auto-closing the related issue when the fix is merged.
Replaced unittest assertions with Pytest assertions and replaced setup and teardown methods with python fixtures
Describe the reason for the change.
Add a list of changes, and note any that might need special attention during review.
test_core.py & test_opentime.py
If no new tests are introduced as part of this PR, note the tests that are providing coverage.