File: test-closest-holiday-current-date.patch

package info (click to toggle)
python-holidays 0.71-3
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 45,404 kB
  • sloc: python: 83,816; javascript: 85; makefile: 62
file content (30 lines) | stat: -rw-r--r-- 1,228 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
From: ~Jhellico <jhellico@gmail.com>
Date: Thu, 1 May 2025 13:52:28 +0300
Subject: Fix `TestClosestHoliday` current date handling

Origin: other, https://github.com/vacanza/holidays/pull/2517
Bug-Debian: https://bugs.debian.org/1104508
Last-Update: 2025-05-01
---
 tests/test_holiday_base.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/test_holiday_base.py b/tests/test_holiday_base.py
index 4951411..5587ada 100644
--- a/tests/test_holiday_base.py
+++ b/tests/test_holiday_base.py
@@ -1286,12 +1286,12 @@ class TestClosestHoliday(unittest.TestCase):
         self.hb = CountryStub3(years=self.current_year)
         self.next_labor_day_year = (
             self.current_year
-            if datetime.now().date() < self.hb.get_named("Custom May 1st Holiday")[0]
+            if datetime.now().date() <= self.hb.get_named("Custom May 1st Holiday")[0]
             else self.next_year
         )
         self.previous_labor_day_year = (
             self.current_year
-            if datetime.now().date() > self.hb.get_named("Custom May 1st Holiday")[0]
+            if datetime.now().date() >= self.hb.get_named("Custom May 2nd Holiday")[0]
             else self.previous_year
         )