-
Notifications
You must be signed in to change notification settings - Fork 198
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SG-31340 Deprecation of Python 2 #295
Merged
Merged
Changes from 7 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
7a097fc
remove references to py2 and skip tests
minna-feng a8e91c6
small fix
minna-feng 34b530e
revert change
minna-feng fd9f448
revert change
minna-feng c250eb9
revert change
minna-feng 4bf915c
revert change
minna-feng 9aaff59
remove badge
minna-feng c522b5d
use assertRaisesRegex
minna-feng File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,28 +53,6 @@ | |
) | ||
|
||
|
||
# FIXME: This should probably be refactored into a base class for | ||
# all test bases | ||
class TestBaseWithExceptionTests(unittest.TestCase): | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice! |
||
""" | ||
Implements a Python 2.4 compatible assertRaisesRegexp like method. This | ||
was introduced in Python 2.7. | ||
""" | ||
def assertRaisesRegexp(self, exception_type, re_msg, func): | ||
try: | ||
func() | ||
except exception_type as exception: | ||
matches = re.findall(re_msg, str(exception)) | ||
if not matches: | ||
self.fail("Expected exception to match '%s', got '%s' instead." % ( | ||
re_msg, str(exception) | ||
)) | ||
except Exception as ex: | ||
self.fail("Expected exception of type %s, got %s" % (exception_type, type(ex))) | ||
else: | ||
self.fail("Expected %s was not raised." % exception_type) | ||
|
||
|
||
class TestMockgunModuleInterface(unittest.TestCase): | ||
""" | ||
mockgun.py was turned into a module. Ensure we haven't broken the interface. | ||
|
@@ -93,7 +71,7 @@ def test_interface_intact(self): | |
mockgun.Shotgun | ||
|
||
|
||
class TestValidateFilterSyntax(TestBaseWithExceptionTests): | ||
class TestValidateFilterSyntax(unittest.TestCase): | ||
""" | ||
Tests filter syntax support. | ||
""" | ||
|
@@ -137,7 +115,7 @@ def test_filter_array_or_dict(self): | |
) | ||
|
||
|
||
class TestEntityFieldComparison(TestBaseWithExceptionTests): | ||
class TestEntityFieldComparison(unittest.TestCase): | ||
""" | ||
Checks if entity fields comparison work. | ||
""" | ||
|
@@ -191,7 +169,7 @@ def test_find_entity_with_none_link(self): | |
self.assertEqual(items[0]["id"], self._project_link["id"]) | ||
|
||
|
||
class TestTextFieldOperators(TestBaseWithExceptionTests): | ||
class TestTextFieldOperators(unittest.TestCase): | ||
""" | ||
Checks if text field comparison work. | ||
""" | ||
|
@@ -210,7 +188,7 @@ def test_operator_contains(self): | |
self.assertTrue(item) | ||
|
||
|
||
class TestMultiEntityFieldComparison(TestBaseWithExceptionTests): | ||
class TestMultiEntityFieldComparison(unittest.TestCase): | ||
""" | ||
Ensures multi entity field comparison work. | ||
""" | ||
|
@@ -293,7 +271,7 @@ def test_find_with_none(self): | |
self.assertTrue(len(item["users"]) > 0) | ||
|
||
|
||
class TestFilterOperator(TestBaseWithExceptionTests): | ||
class TestFilterOperator(unittest.TestCase): | ||
""" | ||
Unit tests for the filter_operator filter syntax. | ||
""" | ||
|
This file contains 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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job on this one!