def test_format_time(): with pytest.warns(FutureWarning, match="dask.utils.format_time") as record: assert format_time(1.4) == " 1.4s" assert format_time(10.4) == "10.4s" assert format_time(100.4) == " 1min 40.4s" assert format_time(1000.4) == "16min 40.4s" assert format_time(10000.4) == " 2hr 46min 40.4s" assert len(record) == 5 # Each `assert` above warns
def _draw_bar(self, frac, elapsed): start = self._start_percentage / 100 frac += start - frac * start bar = "#" * int(self._width * frac) percent = int(100 * frac) elapsed = format_time(elapsed) msg = "[{0:<{1}}] | {2}% Done | {3}".format(bar, self._width, percent, elapsed) self._logging_function(msg, percent)
def test_format_time(): assert format_time(1.4) == " 1.4s" assert format_time(10.4) == "10.4s" assert format_time(100.4) == " 1min 40.4s" assert format_time(1000.4) == "16min 40.4s" assert format_time(10000.4) == " 2hr 46min 40.4s"
def test_format_time(): assert format_time(1.4) == ' 1.4s' assert format_time(10.4) == '10.4s' assert format_time(100.4) == ' 1min 40.4s' assert format_time(1000.4) == '16min 40.4s' assert format_time(10000.4) == ' 2hr 46min 40.4s'