(self)
| 333 | """)) |
| 334 | |
| 335 | def test_main_with_time_unit(self): |
| 336 | unit_sec = self.run_main(seconds_per_increment=0.003, |
| 337 | switches=['-u', 'sec']) |
| 338 | self.assertEqual(unit_sec, |
| 339 | "100 loops, best of 5: 0.003 sec per loop\n") |
| 340 | unit_msec = self.run_main(seconds_per_increment=0.003, |
| 341 | switches=['-u', 'msec']) |
| 342 | self.assertEqual(unit_msec, |
| 343 | "100 loops, best of 5: 3 msec per loop\n") |
| 344 | unit_usec = self.run_main(seconds_per_increment=0.003, |
| 345 | switches=['-u', 'usec']) |
| 346 | self.assertEqual(unit_usec, |
| 347 | "100 loops, best of 5: 3e+03 usec per loop\n") |
| 348 | # Test invalid unit input |
| 349 | with captured_stderr() as error_stringio: |
| 350 | invalid = self.run_main(seconds_per_increment=0.003, |
| 351 | switches=['-u', 'parsec']) |
| 352 | self.assertEqual(error_stringio.getvalue(), |
| 353 | "Unrecognized unit. Please select nsec, usec, msec, or sec.\n") |
| 354 | |
| 355 | @force_not_colorized |
| 356 | def test_main_exception(self): |
nothing calls this directly
no test coverage detected