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 an exemple of unittest usage #369

Merged
merged 1 commit into from Mar 3, 2021

Conversation

romuald
Copy link
Contributor

@romuald romuald commented Feb 19, 2021

This is a simple example of usage inside a classic unittest setUp() clause

@codecov
Copy link

codecov bot commented Feb 19, 2021

Codecov Report

Merging #369 (9a4378d) into master (736fd0e) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #369   +/-   ##
=======================================
  Coverage   96.51%   96.51%           
=======================================
  Files           3        3           
  Lines        1319     1319           
=======================================
  Hits         1273     1273           
  Misses         46       46           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 736fd0e...764c78f. Read the comment docs.


def setUp():
self.responses = responses.RequestsMock()
self.responses.start()
Copy link
Member

Choose a reason for hiding this comment

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

It would be good to give some context on this example and why you would use this instead of using the decorators. Perhaps explaining that this approach can be used when multiple test methods need to use the same mocks?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good idea. I've tried to add a description of the example, but I'm not sure the text is correct

(In the meanwhile I've switched to using pytest fixtures ^^)

This is a simple example of usage inside a classic unittest setUp()
clause
@markstory markstory merged commit 52e7484 into getsentry:master Mar 3, 2021
@markstory
Copy link
Member

Thank you 👍

This was referenced Mar 17, 2021
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.

None yet

2 participants