Skip to content

Commit b140c2f

Browse files
committed
Merge branch 'beta' of github.com:dr-prodigy/python-holidays into beta
2 parents c7d574d + b34f6cb commit b140c2f

File tree

3 files changed

+21
-11
lines changed

3 files changed

+21
-11
lines changed

README.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -439,4 +439,4 @@ License
439439
.. __: https://github.com/dr-prodigy/python-holidays/raw/master/LICENSE
440440

441441
Code and documentation are available according to the MIT License
442-
(see LICENSE__).
442+
(see LICENSE__).

holidays.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2074,21 +2074,23 @@ def _populate(self, year):
20742074

20752075
self[easter(year) - rd(days=2)] = 'Karfreitag'
20762076

2077-
# will always be a Sunday and we have no "observed" rule so
2078-
# this is pretty pointless but it's nonetheless an official
2079-
# holiday by law
2080-
self[easter(year)] = 'Ostersonntag'
2077+
if self.prov == "BB":
2078+
# will always be a Sunday and we have no "observed" rule so
2079+
# this is pretty pointless but it's nonetheless an official
2080+
# holiday by law
2081+
self[easter(year)] = "Ostersonntag"
20812082

20822083
self[easter(year) + rd(days=1)] = 'Ostermontag'
20832084

20842085
self[date(year, MAY, 1)] = 'Erster Mai'
20852086

20862087
self[easter(year) + rd(days=39)] = 'Christi Himmelfahrt'
20872088

2088-
# will always be a Sunday and we have no "observed" rule so
2089-
# this is pretty pointless but it's nonetheless an official
2090-
# holiday by law
2091-
self[easter(year) + rd(days=49)] = 'Pfingstsonntag'
2089+
if self.prov == "BB":
2090+
# will always be a Sunday and we have no "observed" rule so
2091+
# this is pretty pointless but it's nonetheless an official
2092+
# holiday by law
2093+
self[easter(year) + rd(days=49)] = "Pfingstsonntag"
20922094

20932095
self[easter(year) + rd(days=50)] = 'Pfingstmontag'
20942096

tests.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2488,9 +2488,13 @@ def test_ostersonntag(self):
24882488
(2017, 4, 16), (2018, 4, 1), (2019, 4, 21),
24892489
(2020, 4, 12), (2021, 4, 4), (2022, 4, 17),
24902490
(2023, 4, 9), (2024, 3, 31)]
2491+
provinces_that_have = {"BB"}
2492+
provinces_that_dont = set(holidays.DE.PROVINCES) - provinces_that_have
24912493

2492-
for province, (y, m, d) in product(holidays.DE.PROVINCES, known_good):
2494+
for province, (y, m, d) in product(provinces_that_have, known_good):
24932495
self.assertIn(date(y, m, d), self.prov_hols[province])
2496+
for province, (y, m, d) in product(provinces_that_dont, known_good):
2497+
self.assertNotIn(date(y, m, d), self.prov_hols[province])
24942498

24952499
def test_ostermontag(self):
24962500
known_good = [(2014, 4, 21), (2015, 4, 6), (2016, 3, 28),
@@ -2515,9 +2519,13 @@ def test_pfingstsonntag(self):
25152519
(2017, 6, 4), (2018, 5, 20), (2019, 6, 9),
25162520
(2020, 5, 31), (2021, 5, 23), (2022, 6, 5),
25172521
(2023, 5, 28), (2024, 5, 19)]
2522+
provinces_that_have = {"BB"}
2523+
provinces_that_dont = set(holidays.DE.PROVINCES) - provinces_that_have
25182524

2519-
for province, (y, m, d) in product(holidays.DE.PROVINCES, known_good):
2525+
for province, (y, m, d) in product(provinces_that_have, known_good):
25202526
self.assertIn(date(y, m, d), self.prov_hols[province])
2527+
for province, (y, m, d) in product(provinces_that_dont, known_good):
2528+
self.assertNotIn(date(y, m, d), self.prov_hols[province])
25212529

25222530
def test_pfingstmontag(self):
25232531
known_good = [(2014, 6, 9), (2015, 5, 25), (2016, 5, 16),

0 commit comments

Comments
 (0)