def test_return_time(self, freezer): session = Session() session.start() freezer.move_to("2020-06-15 18:56:38") assert str(session.elapsed_time()) == "0:01:41"
def test_increment(self): session = Session() times = randrange(1, 10) for _ in range(times): session.increment_errors() assert session.errors == times
def test_increment(self): session = Session() times = randrange(1, 10) for _ in range(times): session.increment_failures() assert session.failures == times
def test_exit_with_proper_error(self, failures, errors, error_code): session = Session() session.failures = failures session.errors = errors with raises(SystemExit) as excinfo: session.exit() assert excinfo.type == SystemExit assert excinfo.value.code == error_code
def test_init_started_at(self): session = Session() assert str(session.started_at) == "2020-06-15 18:54:57"
def test_failed_when_there_is_failure(self, failures, errors, expected): session = Session() session.failures = failures session.errors = errors assert session.succeed == expected
def test_init_successes_and_failures(self): session = Session() assert session.successes == 0 assert session.failures == 0