Skip to content

Commit

Permalink
Update Poland holidays: fix Ascension Day (#1751)
Browse files Browse the repository at this point in the history
Co-authored-by: Arkadii Yakovets <[email protected]>
  • Loading branch information
KJhellico and arkid15r authored Apr 3, 2024
1 parent b09e276 commit 3171304
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
3 changes: 1 addition & 2 deletions holidays/countries/poland.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
# Website: https://github.com/vacanza/python-holidays
# License: MIT (see LICENSE file)

from datetime import timedelta as td
from gettext import gettext as tr

from holidays.calendars.gregorian import NOV
Expand Down Expand Up @@ -68,7 +67,7 @@ def _populate_public_holidays(self):

if self._year <= 1950:
# Ascension Day.
self._add_holiday(tr("Wniebowstąpienie Pańskie"), self._easter_sunday + td(days=+40))
self._add_ascension_thursday(tr("Wniebowstąpienie Pańskie"))

# Pentecost.
self._add_whit_sunday(tr("Zielone Świątki"))
Expand Down
2 changes: 1 addition & 1 deletion snapshots/countries/PL_COMMON.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"1950-05-01": "National Day",
"1950-05-03": "National Day of the Third of May",
"1950-05-09": "National Victory and Freedom Day",
"1950-05-19": "Ascension Day",
"1950-05-18": "Ascension Day",
"1950-05-28": "Pentecost",
"1950-05-29": "Whit Monday",
"1950-06-08": "Corpus Christi",
Expand Down
14 changes: 8 additions & 6 deletions tests/countries/test_poland.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,19 +138,21 @@ def test_swieto_narodowe_trzeciego_maja(self):

def test_narodowe_swieto_zwyciestwa_i_wolnosci(self):
self.assertHoliday(f"{year}-05-09" for year in range(1946, 1951))
self.assertNoHoliday(f"{year}-05-09" for year in range(1925, 1946))
self.assertNoHoliday(
f"{year}-05-09" for year in set(range(1925, 1946)).difference({1929})
) # Exclude Ascension day on 09/05/1929
self.assertNoHoliday(f"{year}-05-09" for year in range(1951, 2050))
self.assertNoHolidayName(
"Narodowe Święto Zwycięstwa i Wolności", range(1925, 1946), range(1951, 2050)
)

def test_wniebowstapienie_panskie(self):
self.assertHoliday(
"1930-05-30",
"1934-05-11",
"1939-05-19",
"1945-05-11",
"1950-05-19",
"1930-05-29",
"1934-05-10",
"1939-05-18",
"1945-05-10",
"1950-05-18",
)
self.assertNoHolidayName("Wniebowstąpienie Pańskie", range(1951, 2050))

Expand Down

0 comments on commit 3171304

Please sign in to comment.