Skip to content

virtual/python-testing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Python Testing

python3 -m unittest

unittest docs

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:

  1. setUp()
  2. TestCaseMethod()
  3. 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

About

A playground for testing out testing

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages