From 95472ba19b227c110589a222889958b1d8fa54ae Mon Sep 17 00:00:00 2001 From: Willem Van Onsem Date: Sat, 30 Aug 2025 11:50:12 +0200 Subject: [PATCH 1/3] fix action flow --- .github/workflows/build.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f35df46..5f7b9f6 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,7 +12,6 @@ jobs: - uses: psf/black@stable with: options: "--check" - pylint unit_of_time test: name: run tests runs-on: ubuntu-latest From 23f0c6ec0e559c0601a8419d03ab572929b03a9d Mon Sep 17 00:00:00 2001 From: Willem Van Onsem Date: Sat, 30 Aug 2025 11:50:50 +0200 Subject: [PATCH 2/3] black reformatting --- timetest.py | 8 ++++++-- unit_of_time/__init__.py | 4 +++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/timetest.py b/timetest.py index 48a655e..4c7dd43 100644 --- a/timetest.py +++ b/timetest.py @@ -151,8 +151,12 @@ def test_to_int(self): self.assertEqual(tu.previous.previous.previous, 3 << tu) self.assertLess(tu.last_date, tu.next.first_date) self.assertLess(tu.previous.last_date, tu.first_date) - self.assertEqual((tu.next.first_date - tu.last_date), timedelta(days=1)) - self.assertEqual((tu.first_date - tu.previous.last_date), timedelta(days=1)) + self.assertEqual( + (tu.next.first_date - tu.last_date), timedelta(days=1) + ) + self.assertEqual( + (tu.first_date - tu.previous.last_date), timedelta(days=1) + ) def test_hierarchy(self): """ diff --git a/unit_of_time/__init__.py b/unit_of_time/__init__.py index 3ce1503..7421d21 100644 --- a/unit_of_time/__init__.py +++ b/unit_of_time/__init__.py @@ -36,7 +36,9 @@ def unit_register(cls): result = TimeunitKindMeta._registered if result is None: result = { - k.kind_int: k for k in TimeunitKindMeta._pre_registered if k.kind_int is not None + k.kind_int: k + for k in TimeunitKindMeta._pre_registered + if k.kind_int is not None } TimeunitKindMeta._registered = result return result From 051ef9c298173c6a32e06dd7d7bb90690ddbe243 Mon Sep 17 00:00:00 2001 From: Willem Van Onsem Date: Sat, 30 Aug 2025 14:58:14 +0200 Subject: [PATCH 3/3] add cover --- timetest.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/timetest.py b/timetest.py index 4c7dd43..c871973 100644 --- a/timetest.py +++ b/timetest.py @@ -110,6 +110,8 @@ def test_to_int(self): self.assertIn(dt, tu) self.assertIn((dt, dt), tu) self.assertIn((tu.first_date, tu.last_date), tu) + with self.assertRaises(TypeError): + self.assertIn((1958, 2019), tu) with self.assertRaises(TypeError): self.assertIn(1425, tu) self.assertIn(dt, list(tu))