Skip to content

Migrate unit/test_streaming_client_stream_encryptor.py from unittest to pytest #127

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

Merged
merged 2 commits into from
Dec 17, 2018
Merged

Migrate unit/test_streaming_client_stream_encryptor.py from unittest to pytest #127

merged 2 commits into from
Dec 17, 2018

Conversation

ansanper
Copy link
Contributor

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.

@ansanper ansanper mentioned this pull request Dec 14, 2018
16 tasks
def setUp(self):
class TestStreamEncryptor(object):
@pytest.fixture(autouse=True)
def apply_fixtures(self):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

test_encryptor._read_bytes(5)
execinfo.match("Unsupported content type")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo:

Suggested change
execinfo.match("Unsupported content type")
excinfo.match("Unsupported content type")

@mattsb42-aws mattsb42-aws merged commit 5c4232a into aws:master Dec 17, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants