GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Unit-Testing-Koans/python-unittest at master · codecop/Unit-Testing-Koans

Expand file tree

/

python-unittest

/
Copy path

Directory actions

More options

More options

Directory actions

More options

More options

Latest commit

 

History

History
History
/

python-unittest

/
Copy path

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
packages
packages
 
 
ruby
ruby
 
 
test
test
 
 
wordcount
wordcount
 
 
.gitignore
.gitignore
 
 
README.md
README.md
 
 
build.xml
build.xml
 
 
requirements.txt
requirements.txt
 
 
run_first_session.bat
run_first_session.bat
 
 
run_first_session.sh
run_first_session.sh
 
 
run_tests.bat
run_tests.bat
 
 
run_tests.sh
run_tests.sh
 
 

README.md

Outline

Python-Unittest-Koans

Python Testing Koans to understand how to write unit tests with unittest.

Dependencies

This is a Python project. It is compatible with both Python 2 and 3. Required dependencies are listed in requirements.txt.

Additional exercises cover parameterized, PyHamcrest and assertpy. Run pip install -r requirements.txt to install the required packages. Alternatively the dependencies are available in the packages folder.

Assignment

  • Run script run_tests (or python -m unittest discover test).
  • You should see some test failures and errors (but there are no assertions).
  • Go through the test code starting from Session 1:
    • All assertions are commented and incomplete.
    • Uncomment the assertions and complete them making the tests pass.
    • You can run individual sessions using python -m unittest test.test_session1_greeter (Note: Unittest looks for modules not files. Make sure to use test. not test/ and no trailing .py.)
You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.