cursewords icon indicating copy to clipboard operation
cursewords copied to clipboard

Add some tests for formatting time for display!

Open nelhage opened this issue 6 years ago • 2 comments

  • Add requirements.dev.txt to install py.test
  • Refactor Timer slightly so we can call the formatting method without an instance
  • Add some tests! Just include some examples that span the range from seconds to hours, and verify that they display properly.

nelhage avatar Mar 03 '19 21:03 nelhage

Awesome, thank you so much!

thisisparker avatar Mar 03 '19 21:03 thisisparker

Oh I forget to mention -- just run pytest test/ to run the tests. Probably I could figure out how to hook it up to setup.py

This is often where I'll start testing an extant piece of code -- don't try to test everything, but find bits that are easy to exercise automatically and useful (in this case, especially because testing by hand otherwise involves waiting an hour or hacking something up!)

nelhage avatar Mar 03 '19 22:03 nelhage