Skip to content
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

Add ensure_teardownclass context manager to pulp_smash.utils #1187

Merged
merged 1 commit into from
Mar 19, 2019

Conversation

rochacbruno
Copy link
Member

Unittest will not execute tearDownClass if an error occurs on classmethods
this contextmanager will ensure that method is executed in case of error.

Usage:

@classmethod
def setUpClass(cls):
    with ensure_teardownclass(cls):
        1 / 0  # raises ZeroDivisionError

without ensure_teardownclass after that exception, tearDownClass
would never be executed, but the context manager ensure it.

Unittest will not execute tearDownClass if an error occurs on classmethods
this contextmanager will ensure that method is executed in case of error.

Usage:

```py
@classmethod
def setUpClass(cls):
    with ensure_teardownclass(cls):
        1 / 0  # raises ZeroDivisionError
```

without `ensure_teardownclass` after that exception, tearDownClass
would never be executed, but the context manager ensure it.
rochacbruno added a commit to rochacbruno/pulp-certguard that referenced this pull request Mar 18, 2019
- Add testcase for certguard api (assert protected distribution)
- Add a bunch if `dummy` generated self-signed certificates for testing purposes

Requires PRs:

pulp/pulp-smash#1184
pulp/pulp-smash#1185
pulp/pulp-smash#1186
pulp/pulp-smash#1187

Related issues:

https://pulp.plan.io/issues/4122
https://pulp.plan.io/issues/3969
https://pulp.plan.io/issues/3970

closes #4122
@rochacbruno rochacbruno merged commit 07235dd into pulp:master Mar 19, 2019
@rochacbruno rochacbruno deleted the ensure_teardown branch March 19, 2019 21:57
rochacbruno added a commit to rochacbruno/pulp-certguard that referenced this pull request Mar 19, 2019
- Add testcase for certguard api (assert protected distribution)
- Add a some `dummy` generated self-signed certificates for testing purposes

Related PRs:

pulp/pulp-smash#1185
pulp/pulp-smash#1186
pulp/pulp-smash#1187

Related issues:

https://pulp.plan.io/issues/4122
https://pulp.plan.io/issues/3969
https://pulp.plan.io/issues/3970

closes #4122

Required PR: pulp/pulp-smash#1184
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