-
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Configure a setUp()
method
#2
Merged
Merged
Conversation
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
kaiosilveira
force-pushed
the
chapter19/set-the-table
branch
from
March 17, 2023 21:34
eba0c82
to
09487a9
Compare
kaiosilveira
changed the base branch from
main
to
chapter18/first-steps-to-xunit
March 18, 2023 08:20
kaiosilveira
force-pushed
the
chapter18/first-steps-to-xunit
branch
6 times, most recently
from
March 18, 2023 09:54
3c77585
to
bf17e19
Compare
kaiosilveira
force-pushed
the
chapter19/set-the-table
branch
6 times, most recently
from
March 18, 2023 10:38
01b50f8
to
ec22cf5
Compare
Checklist: - Invoke setUp first 👈🏼 - Invoke tearDown afterward - Invoke tearDown even if the test method fails - Run multiple tests - Report collected results --- Output: ➜ python3 src/TestCaseTest.py Traceback (most recent call last): File "tdd-xunit-example/src/TestCaseTest.py", line 19, in <module> TestCaseTest("testSetup").run() File "tdd-xunit-example/src/TestCase.py", line 8, in run method() File "tdd-xunit-example/src/TestCaseTest.py", line 15, in testSetup assert (test.wasSetUp) ^^^^^^^^^^^^^ AttributeError: 'WasRun' object has no attribute 'wasSetUp'
Checklist: - Invoke setUp first 👈🏼 - Invoke tearDown afterward - Invoke tearDown even if the test method fails - Run multiple tests - Report collected results --- Output: ➜ python3 src/TestCaseTest.py Traceback (most recent call last): File "tdd-xunit-example/src/TestCaseTest.py", line 19, in <module> TestCaseTest("testSetup").run() File "tdd-xunit-example/src/TestCase.py", line 8, in run method() File "tdd-xunit-example/src/TestCaseTest.py", line 15, in testSetup assert (test.wasSetUp) ^^^^^^^^^^^^^ AttributeError: 'WasRun' object has no attribute 'wasSetUp'
Checklist: - Invoke setUp first 👈🏼 - Invoke tearDown afterward - Invoke tearDown even if the test method fails - Run multiple tests - Report collected results
Checklist: - Invoke setUp first 👈🏼 - Invoke tearDown afterward - Invoke tearDown even if the test method fails - Run multiple tests - Report collected results --- Output: ➜ python3 src/TestCaseTest.py Traceback (most recent call last): File "tdd-xunit-example/src/TestCaseTest.py", line 18, in <module> TestCaseTest("testRunning").run() File "tdd-xunit-example/src/TestCase.py", line 12, in run method() File "tdd-xunit-example/src/TestCaseTest.py", line 8, in testRunning assert (not test.wasRun) ^^^^^^^^^^^ AttributeError: 'WasRun' object has no attribute 'wasRun'
Checklist: - Invoke setUp first 👈🏼 - Invoke tearDown afterward - Invoke tearDown even if the test method fails - Run multiple tests - Report collected results
Checklist: - Invoke setUp first ✅ - Invoke tearDown afterward - Invoke tearDown even if the test method fails - Run multiple tests - Report collected results
kaiosilveira
force-pushed
the
chapter19/set-the-table
branch
from
March 18, 2023 10:40
ec22cf5
to
1de7bc9
Compare
Closed
kaiosilveira
changed the base branch from
chapter18/first-steps-to-xunit
to
main
March 18, 2023 11:34
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.
Chapter 19: Set the table
Our goal in this chapter was to implement a
setUp()
method, commonly used in test classes to configure repetitive boilerplate in order to run the tests.Implementation checklist:
✅
Invoke test method✅
Invoke setUp first☑️ Invoke tearDown afterward
☑️ Invoke tearDown even if the test method fails
☑️ Run multiple tests
☑️ Report collected results
Closes #5