def test_scenario_ellapsed_returns_seconds(): scenario = Scenario(index="1", title="Something", story=None) scenario.start_run() time.sleep(0.1) scenario.end_run() expected = "0.1" ellapsed = "%.1f" % scenario.ellapsed() assert ellapsed == expected, "The ellapsed time should be %s but was %s" % (expected, ellapsed)
def test_scenario_ellapsed_returns_seconds(): scenario = Scenario(index="1", title="Something", story=None) scenario.start_run() time.sleep(0.1) scenario.end_run() expected = "0.1" ellapsed = "%.1f" % scenario.ellapsed() assert ellapsed == expected, "The ellapsed time should be %s but was %s" % ( expected, ellapsed)
def test_scenario_end_run_marks_time(): scenario = Scenario(index="1", title="Something", story=None) scenario.end_run() assert scenario.end_time is not None, "There should be some end time after end_run"