Migrate unit/test_streaming_client_stream_encryptor.py from unittest to pytest#127
Merged
mattsb42-aws merged 2 commits intoaws:masterfrom Dec 17, 2018
ansanchezhub:test/unit/test_streaming_client_stream_encryptor.py
Merged
Migrate unit/test_streaming_client_stream_encryptor.py from unittest to pytest#127mattsb42-aws merged 2 commits intoaws:masterfrom ansanchezhub:test/unit/test_streaming_client_stream_encryptor.py
mattsb42-aws merged 2 commits intoaws:masterfrom
ansanchezhub:test/unit/test_streaming_client_stream_encryptor.py
Conversation
16 tasks
mattsb42-aws
requested changes
Dec 15, 2018
| def setUp(self): | ||
| class TestStreamEncryptor(object): | ||
| @pytest.fixture(autouse=True) | ||
| def apply_fixtures(self): |
Member
There was a problem hiding this comment.
We also need to run the old tearDown actions after the tests are done. This is what is likely causing most of the test failures.
This should work by just running them in this method after a yield.
@pytest.fixture(autouse=True)
def apply_fixtures(self):
do_stuff_from_old_setup()
yield
do_stuff_from_old_teardown()https://docs.pytest.org/en/latest/fixture.html#autouse-fixtures-xunit-setup-on-steroids
| with six.assertRaisesRegex(self, NotSupportedError, "Unsupported content type"): | ||
| with pytest.raises(NotSupportedError) as excinfo: | ||
| test_encryptor._read_bytes(5) | ||
| execinfo.match("Unsupported content type") |
Member
There was a problem hiding this comment.
Typo:
Suggested change
| execinfo.match("Unsupported content type") | |
| excinfo.match("Unsupported content type") |
This was referenced Dec 15, 2018
mattsb42-aws
approved these changes
Dec 17, 2018
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.
Issue #, if available: #99
Description of changes:
Migrated "test/unit/test_streaming_client_stream_encryptor.py" from unittest to pytest
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.