From a1e2f3d001defcadd281d51e2b4ca62a7b1bf2b6 Mon Sep 17 00:00:00 2001 From: Casper da Costa-Luis Date: Sun, 14 Oct 2018 23:23:13 +0100 Subject: [PATCH] unit tests --- tqdm/tests/tests_tqdm.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/tqdm/tests/tests_tqdm.py b/tqdm/tests/tests_tqdm.py index e8dc7592..20821ac9 100644 --- a/tqdm/tests/tests_tqdm.py +++ b/tqdm/tests/tests_tqdm.py @@ -209,6 +209,15 @@ def test_format_interval(): assert format_interval(238113) == '66:08:33' +def test_format_num(): + """Test number format""" + format_num = tqdm.format_num + + assert float(format_num(1337)) == 1337 + assert format_num(int(1e6)) == '1e+6' + assert format_num(1239876) == '1''239''876' + + def test_format_meter(): """Test statistics and progress bar formatting""" try: