-
-
Notifications
You must be signed in to change notification settings - Fork 0
Bootstrap the testing framework #1
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
Conversation
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
bcf3dfc to
5dfdef8
Compare
93aa8b9 to
2fb6ee7
Compare
Checklist:
- Invoke test method 👈🏼
- Invoke setUp first
- Invoke tearDown afterward
- Invoke tearDown even if the test method fails
- Run multiple tests
- Report collected results
---
Output:
➜ python3 index.py
Traceback (most recent call last):
File "tdd-xunit-example/index.py", line 1, in <module>
test = WasRun("testMethod")
^^^^^^
NameError: name 'WasRun' is not defined
Checklist:
- Invoke test method 👈🏼
- Invoke setUp first
- Invoke tearDown afterward
- Invoke tearDown even if the test method fails
- Run multiple tests
- Report collected results
---
Output:
➜ python3 src/index.py
Traceback (most recent call last):
File "tdd-xunit-example/src/index.py", line 3, in <module>
test = WasRun("testMethod")
^^^^^^^^^^^^^^^^^^^^
TypeError: WasRun() takes no arguments
Checklist:
- Invoke test method 👈🏼
- Invoke setUp first
- Invoke tearDown afterward
- Invoke tearDown even if the test method fails
- Run multiple tests
- Report collected results
---
Output:
➜ python3 src/index.py
None
Traceback (most recent call last):
File "tdd-xunit-example/src/index.py", line 5, in <module>
test.testMethod()
^^^^^^^^^^^^^^^
AttributeError: 'WasRun' object has no attribute 'testMethod'
Checklist: - Invoke test method 👈🏼 - Invoke setUp first - Invoke tearDown afterward - Invoke tearDown even if the test method fails - Run multiple tests - Report collected results --- Output: ➜ python3 src/index.py None None
Checklist: - Invoke test method 👈🏼 - Invoke setUp first - Invoke tearDown afterward - Invoke tearDown even if the test method fails - Run multiple tests - Report collected results --- Output: ➜ python3 src/index.py None 1
Checklist:
- Invoke test method 👈🏼
- Invoke setUp first
- Invoke tearDown afterward
- Invoke tearDown even if the test method fails
- Run multiple tests
- Report collected results
---
Output:
➜ python3 src/index.py
None
Traceback (most recent call last):
File "tdd-xunit-example/src/index.py", line 5, in <module>
test.run()
^^^^^^^^
AttributeError: 'WasRun' object has no attribute 'run'
Checklist: - Invoke test method 👈🏼 - Invoke setUp first - Invoke tearDown afterward - Invoke tearDown even if the test method fails - Run multiple tests - Report collected results --- Output: ➜ python3 src/index.py None 1
Checklist: - Invoke test method 👈🏼 - Invoke setUp first - Invoke tearDown afterward - Invoke tearDown even if the test method fails - Run multiple tests - Report collected results --- Output: ➜ python3 src/index.py None 1
Checklist: - Invoke test method 👈🏼 - Invoke setUp first - Invoke tearDown afterward - Invoke tearDown even if the test method fails - Run multiple tests - Report collected results
Checklist: - Invoke test method 👈🏼 - Invoke setUp first - Invoke tearDown afterward - Invoke tearDown even if the test method fails - Run multiple tests - Report collected results
Checklist: - Invoke test method 👈🏼 - Invoke setUp first - Invoke tearDown afterward - Invoke tearDown even if the test method fails - Run multiple tests - Report collected results
Checklist: - Invoke test method 👈🏼 - Invoke setUp first - Invoke tearDown afterward - Invoke tearDown even if the test method fails - Run multiple tests - Report collected results
2fb6ee7 to
3a3422a
Compare
3a3422a to
3c77585
Compare
Checklist: - Invoke test method ✅ - Invoke setUp first - Invoke tearDown afterward - Invoke tearDown even if the test method fails - Run multiple tests - Report collected results
3c77585 to
bf17e19
Compare
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 18: First steps to xUnit
Our goal in this chapter was to bootstrap our testing framework and use it to test itself. We accomplished that by making teeny-tiny steps towards a
TestCaseclass, which will be the core part of our system, and finished with a test for the class itself.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 #3