python3 -m unittest
You can skip a test case by adding a line above the def:
@unittest.skip("WIP")
def test_name(self):
Maintain a good test suite:
All the test cases are using phonebook = Phonebook()
, is there a way to clean this up?
Use Test Fixture:
- setUp()
- TestCaseMethod()
- tearDown()
Test structure:
- Arrange: add entries
- Act: check using method
- Assert: whether the act returns correctly (true / false)
Each test should be its own definition, if you're using comments to explain, it probably needs to be broken up into more defs