diff --git a/holidays/countries/albania.py b/holidays/countries/albania.py index 431591cb6..a5b81dac2 100644 --- a/holidays/countries/albania.py +++ b/holidays/countries/albania.py @@ -21,11 +21,7 @@ class Albania( - ObservedHolidayBase, - ChristianHolidays, - InternationalHolidays, - IslamicHolidays, - StaticHolidays, + ObservedHolidayBase, ChristianHolidays, InternationalHolidays, IslamicHolidays, StaticHolidays ): """ References: diff --git a/holidays/countries/belize.py b/holidays/countries/belize.py index 62ce2c3f1..7d8b2d1a1 100644 --- a/holidays/countries/belize.py +++ b/holidays/countries/belize.py @@ -93,8 +93,7 @@ def _populate_public_holidays(self): # Indigenous Peoples' Resistance Day / Pan American Day. name = "Indigenous Peoples' Resistance Day" if self._year >= 2021 else "Pan American Day" self._move_holiday( - self._add_columbus_day(name), - rule=TUE_WED_THU_TO_PREV_MON + FRI_SUN_TO_NEXT_MON, + self._add_columbus_day(name), rule=TUE_WED_THU_TO_PREV_MON + FRI_SUN_TO_NEXT_MON ) # Garifuna Settlement Day. diff --git a/holidays/countries/bulgaria.py b/holidays/countries/bulgaria.py index 194e91a9d..c3f0a32eb 100644 --- a/holidays/countries/bulgaria.py +++ b/holidays/countries/bulgaria.py @@ -125,8 +125,7 @@ def _populate_public_holidays(self): if self.observed: self._populate_observed( - dts_observed, - excluded_names={self.tr("Велика събота"), self.tr("Великден")}, + dts_observed, excluded_names={self.tr("Велика събота"), self.tr("Великден")} ) def _populate_school_holidays(self): diff --git a/holidays/countries/cambodia.py b/holidays/countries/cambodia.py index aa5df5e2f..7c56e3ee2 100644 --- a/holidays/countries/cambodia.py +++ b/holidays/countries/cambodia.py @@ -146,8 +146,7 @@ def _populate_public_holidays(self): if self._year >= 1994: self._add_holiday_jun_18( - # Birthday of Her Majesty the Queen-Mother - # NORODOM MONINEATH SIHANOUK of Cambodia + # Birthday of Her Majesty the Queen-Mother NORODOM MONINEATH SIHANOUK of Cambodia tr("ព្រះរាជពិធីបុណ្យចម្រើនព្រះជន្ម សម្តេចព្រះមហាក្សត្រី ព្រះវររាជមាតា នរោត្តម មុនិនាថ សីហនុ"), ) diff --git a/holidays/countries/cameroon.py b/holidays/countries/cameroon.py index ab2dc014a..0870f5ee0 100644 --- a/holidays/countries/cameroon.py +++ b/holidays/countries/cameroon.py @@ -21,11 +21,7 @@ class Cameroon( - ObservedHolidayBase, - ChristianHolidays, - InternationalHolidays, - IslamicHolidays, - StaticHolidays, + ObservedHolidayBase, ChristianHolidays, InternationalHolidays, IslamicHolidays, StaticHolidays ): """ References: diff --git a/holidays/countries/chad.py b/holidays/countries/chad.py index 28e351b50..eeeb1e910 100644 --- a/holidays/countries/chad.py +++ b/holidays/countries/chad.py @@ -21,11 +21,7 @@ class Chad( - ObservedHolidayBase, - ChristianHolidays, - InternationalHolidays, - IslamicHolidays, - StaticHolidays, + ObservedHolidayBase, ChristianHolidays, InternationalHolidays, IslamicHolidays, StaticHolidays ): """ References: diff --git a/holidays/countries/china.py b/holidays/countries/china.py index b221751ea..51588eb75 100644 --- a/holidays/countries/china.py +++ b/holidays/countries/china.py @@ -441,15 +441,7 @@ class ChinaStaticHolidays: 2012: (JUN, 22, dragon_boat_festival), # observed from Jun 23 2015: (OCT, 6, mid_autumn_festival), # observed from Sep 27 2020: ( - ( - JAN, - 30, - chinese_new_year, - ), # Spring Festival (extended due to Covid-19 decree) - ( - OCT, - 6, - mid_autumn_festival, - ), # observed from Oct 1, overlap with National Day + (JAN, 30, chinese_new_year), # Spring Festival (extended due to Covid-19 decree) + (OCT, 6, mid_autumn_festival), # observed from Oct 1, overlap with National Day ), } diff --git a/holidays/countries/hongkong.py b/holidays/countries/hongkong.py index 85bb84cbc..e2e9d0fbc 100644 --- a/holidays/countries/hongkong.py +++ b/holidays/countries/hongkong.py @@ -153,8 +153,7 @@ def _populate_public_holidays(self): self._add_mid_autumn_festival(name) else: self._add_holiday( - f"The second day of the {name} (Monday)", - mid_autumn_date + td(days=+2), + f"The second day of the {name} (Monday)", mid_autumn_date + td(days=+2) ) else: self._add_mid_autumn_festival_day_two(f"The day following the {name}") diff --git a/holidays/countries/ireland.py b/holidays/countries/ireland.py index 534b26cc0..9ef6cf781 100644 --- a/holidays/countries/ireland.py +++ b/holidays/countries/ireland.py @@ -75,8 +75,7 @@ def _populate_public_holidays(self): # St. Stephen's Day. self._add_observed( - self._add_christmas_day_two("St. Stephen's Day"), - rule=SAT_SUN_TO_NEXT_MON_TUE, + self._add_christmas_day_two("St. Stephen's Day"), rule=SAT_SUN_TO_NEXT_MON_TUE ) diff --git a/holidays/countries/malaysia.py b/holidays/countries/malaysia.py index 07bdf6923..1edb325e3 100644 --- a/holidays/countries/malaysia.py +++ b/holidays/countries/malaysia.py @@ -227,18 +227,7 @@ def _populate_public_holidays(self): dts_observed.update(self._add_ramadan_beginning_day("Beginning of Ramadan")) # Nuzul Al-Quran Day. - if self.subdiv in { - "KTN", - "KUL", - "LBN", - "PHG", - "PJY", - "PLS", - "PNG", - "PRK", - "SGR", - "TRG", - }: + if self.subdiv in {"KTN", "KUL", "LBN", "PHG", "PJY", "PLS", "PNG", "PRK", "SGR", "TRG"}: dts_observed.update(self._add_nuzul_al_quran_day("Nuzul Al-Quran Day")) # Thaipusam. diff --git a/holidays/countries/marshall_islands.py b/holidays/countries/marshall_islands.py index 68d670034..5e6ec5995 100644 --- a/holidays/countries/marshall_islands.py +++ b/holidays/countries/marshall_islands.py @@ -35,8 +35,7 @@ def __init__(self, *args, **kwargs): def _populate_public_holidays(self): if self._year <= 2019: warnings.warn( - "Years before 2020 are not available for the Marshall Islands (MH).", - Warning, + "Years before 2020 are not available for the Marshall Islands (MH).", Warning ) # New Year's Day diff --git a/holidays/countries/new_zealand.py b/holidays/countries/new_zealand.py index 211c21f6a..1b126bd23 100644 --- a/holidays/countries/new_zealand.py +++ b/holidays/countries/new_zealand.py @@ -97,8 +97,7 @@ def _populate_public_holidays(self): # New Year's Day self._add_observed(self._add_new_years_day("New Year's Day"), rule=SAT_SUN_TO_NEXT_MON_TUE) self._add_observed( - self._add_new_years_day_two("Day after New Year's Day"), - rule=SAT_SUN_TO_NEXT_MON_TUE, + self._add_new_years_day_two("Day after New Year's Day"), rule=SAT_SUN_TO_NEXT_MON_TUE ) # Waitangi Day diff --git a/holidays/countries/nigeria.py b/holidays/countries/nigeria.py index 7e228ff76..e719d353e 100644 --- a/holidays/countries/nigeria.py +++ b/holidays/countries/nigeria.py @@ -20,11 +20,7 @@ class Nigeria( - ObservedHolidayBase, - ChristianHolidays, - InternationalHolidays, - IslamicHolidays, - StaticHolidays, + ObservedHolidayBase, ChristianHolidays, InternationalHolidays, IslamicHolidays, StaticHolidays ): """ https://en.wikipedia.org/wiki/Public_holidays_in_Nigeria diff --git a/holidays/countries/philippines.py b/holidays/countries/philippines.py index e783a6bc5..4a9152e1c 100644 --- a/holidays/countries/philippines.py +++ b/holidays/countries/philippines.py @@ -20,11 +20,7 @@ class Philippines( - HolidayBase, - ChineseCalendarHolidays, - ChristianHolidays, - InternationalHolidays, - IslamicHolidays, + HolidayBase, ChineseCalendarHolidays, ChristianHolidays, InternationalHolidays, IslamicHolidays ): """ Philippines holidays. diff --git a/holidays/countries/south_korea.py b/holidays/countries/south_korea.py index 63898d5c6..e4fe15d48 100644 --- a/holidays/countries/south_korea.py +++ b/holidays/countries/south_korea.py @@ -94,8 +94,7 @@ def _populate_observed(self, dts: Set[date], three_day_holidays: Dict[date, str] if not self._is_observed(dt): continue dt_observed = self._get_observed_date( - dt, - SUN_TO_NEXT_WORKDAY if dt in three_day_holidays else SAT_SUN_TO_NEXT_WORKDAY, + dt, SUN_TO_NEXT_WORKDAY if dt in three_day_holidays else SAT_SUN_TO_NEXT_WORKDAY ) if dt_observed != dt or len(self.get_list(dt)) > 1: if dt_observed == dt: diff --git a/holidays/countries/spain.py b/holidays/countries/spain.py index 7432a5ca1..d1ad8d8e8 100644 --- a/holidays/countries/spain.py +++ b/holidays/countries/spain.py @@ -23,11 +23,7 @@ class Spain( - ObservedHolidayBase, - ChristianHolidays, - InternationalHolidays, - IslamicHolidays, - StaticHolidays, + ObservedHolidayBase, ChristianHolidays, InternationalHolidays, IslamicHolidays, StaticHolidays ): """ Holidays checked with official sources for 2010-2023 only. diff --git a/holidays/countries/tanzania.py b/holidays/countries/tanzania.py index 1c6f92296..01d422214 100644 --- a/holidays/countries/tanzania.py +++ b/holidays/countries/tanzania.py @@ -24,11 +24,7 @@ class Tanzania( - HolidayBase, - ChristianHolidays, - InternationalHolidays, - IslamicHolidays, - StaticHolidays, + HolidayBase, ChristianHolidays, InternationalHolidays, IslamicHolidays, StaticHolidays ): """ References: diff --git a/holidays/countries/timor_leste.py b/holidays/countries/timor_leste.py index 8519a5631..744de2715 100644 --- a/holidays/countries/timor_leste.py +++ b/holidays/countries/timor_leste.py @@ -24,11 +24,7 @@ class TimorLeste( - HolidayBase, - ChristianHolidays, - InternationalHolidays, - IslamicHolidays, - StaticHolidays, + HolidayBase, ChristianHolidays, InternationalHolidays, IslamicHolidays, StaticHolidays ): """ References: diff --git a/holidays/countries/united_states.py b/holidays/countries/united_states.py index 21d9922c2..0a7b3e114 100644 --- a/holidays/countries/united_states.py +++ b/holidays/countries/united_states.py @@ -164,22 +164,12 @@ def _add_christmas_eve_holiday(self): # If on Saturday or Sunday, observed on Friday name = "Christmas Eve" self._add_observed( - self._add_christmas_eve(name), - name=name, - rule=FRI_TO_PREV_THU + SAT_SUN_TO_PREV_FRI, + self._add_christmas_eve(name), name=name, rule=FRI_TO_PREV_THU + SAT_SUN_TO_PREV_FRI ) def _populate_subdiv_holidays(self): # Martin Luther King Jr. Day - if self._year >= 1986 and self.subdiv not in { - "AL", - "AR", - "AZ", - "GA", - "ID", - "MS", - "NH", - }: + if self._year >= 1986 and self.subdiv not in {"AL", "AR", "AZ", "GA", "ID", "MS", "NH"}: self._add_holiday_3rd_mon_of_jan("Martin Luther King Jr. Day") # Washington's Birthday diff --git a/holidays/countries/vanuatu.py b/holidays/countries/vanuatu.py index 9d4a06fe3..4bace4115 100644 --- a/holidays/countries/vanuatu.py +++ b/holidays/countries/vanuatu.py @@ -78,8 +78,7 @@ def _populate_public_holidays(self): # Family Day. self._add_observed( - self._add_christmas_day_two("Family Day"), - rule=SUN_TO_NEXT_MON + MON_TO_NEXT_TUE, + self._add_christmas_day_two("Family Day"), rule=SUN_TO_NEXT_MON + MON_TO_NEXT_TUE ) diff --git a/holidays/countries/zambia.py b/holidays/countries/zambia.py index 300de69b9..8c96c3a82 100644 --- a/holidays/countries/zambia.py +++ b/holidays/countries/zambia.py @@ -100,11 +100,7 @@ class ZambiaStaticHolidays: special_public_holidays = { 2016: ( (AUG, 11, "General elections and referendum"), - ( - SEP, - 13, - "Inauguration ceremony of President-elect and Vice President-elect", - ), + (SEP, 13, "Inauguration ceremony of President-elect and Vice President-elect"), ), 2018: ( (MAR, 9, "Public holiday"), diff --git a/holidays/groups/christian.py b/holidays/groups/christian.py index f4c8c2c54..de44351ad 100644 --- a/holidays/groups/christian.py +++ b/holidays/groups/christian.py @@ -74,11 +74,7 @@ def __verify_calendar(calendar): """ Verify calendar type. """ - if calendar not in { - GREGORIAN_CALENDAR, - JULIAN_CALENDAR, - JULIAN_REVISED_CALENDAR, - }: + if calendar not in {GREGORIAN_CALENDAR, JULIAN_CALENDAR, JULIAN_REVISED_CALENDAR}: raise ValueError( f"Unknown calendar name: {calendar}. " f"Use `{GREGORIAN_CALENDAR}`, `{JULIAN_CALENDAR}` or `{JULIAN_REVISED_CALENDAR}`." diff --git a/holidays/holiday_base.py b/holidays/holiday_base.py index 457565e18..8ff17af65 100644 --- a/holidays/holiday_base.py +++ b/holidays/holiday_base.py @@ -480,8 +480,7 @@ def __getattr__(self, name): # Handle patterns (e.g., # _add_holiday_1st_mon_before_jun_15() or _add_holiday_1st_mon_from_jun_15()). nth_weekday_from = re.match( - r"_add_holiday_(\d{1,2})\w{2}_(\w+)_(before|from)_(\w{3})_(\d{1,2})", - name, + r"_add_holiday_(\d{1,2})\w{2}_(\w+)_(before|from)_(\w{3})_(\d{1,2})", name ) if nth_weekday_from: number, weekday, date_direction, month, day = nth_weekday_from.groups() @@ -709,9 +708,7 @@ def _add_special_holidays(self, mapping_names, observed=False): self._add_holiday( self.tr(self.substituted_label) % date( - optional[0] if optional else self._year, - from_month, - from_day, + optional[0] if optional else self._year, from_month, from_day ).strftime(self.tr(self.substituted_date_format)), to_month, to_day, diff --git a/holidays/observed_holiday_base.py b/holidays/observed_holiday_base.py index 0f0372572..3ca02d79c 100644 --- a/holidays/observed_holiday_base.py +++ b/holidays/observed_holiday_base.py @@ -123,10 +123,7 @@ def _get_observed_date(self, dt: date, rule: ObservedRule) -> date: return dt def _add_observed( - self, - dt: DateArg, - name: Optional[str] = None, - rule: Optional[ObservedRule] = None, + self, dt: DateArg, name: Optional[str] = None, rule: Optional[ObservedRule] = None ) -> Tuple[bool, date]: dt = dt if isinstance(dt, date) else date(self._year, *dt) diff --git a/holidays/registry.py b/holidays/registry.py index 314d78565..1cb877edb 100644 --- a/holidays/registry.py +++ b/holidays/registry.py @@ -154,12 +154,7 @@ "UMI", "HolidaysUM", ), - "united_states_virgin_islands": ( - "UnitedStatesVirginIslands", - "VI", - "VIR", - "HolidaysVI", - ), + "united_states_virgin_islands": ("UnitedStatesVirginIslands", "VI", "VIR", "HolidaysVI"), "united_states": ("UnitedStates", "US", "USA"), "uruguay": ("Uruguay", "UY", "URY"), "uzbekistan": ("Uzbekistan", "UZ", "UZB"), diff --git a/holidays/utils.py b/holidays/utils.py index 8c2f67d66..4970d3dc8 100755 --- a/holidays/utils.py +++ b/holidays/utils.py @@ -276,8 +276,7 @@ def CountryHoliday( """ warnings.warn( - "CountryHoliday is deprecated, use country_holidays instead.", - DeprecationWarning, + "CountryHoliday is deprecated, use country_holidays instead.", DeprecationWarning ) return country_holidays(country, subdiv, years, expand, observed, prov, state) diff --git a/tests/countries/test_argentina.py b/tests/countries/test_argentina.py index 54b016a8c..c304abb9f 100644 --- a/tests/countries/test_argentina.py +++ b/tests/countries/test_argentina.py @@ -104,8 +104,7 @@ def test_sovereignty_over_malvinas_day(self): def test_guemes_day(self): self.assertNonObservedHoliday(f"{year}-06-17" for year in range(2016, 2050)) self.assertNoHolidayName( - "Paso a la Inmortalidad del General Don Martín Miguel de Güemes", - range(1950, 2016), + "Paso a la Inmortalidad del General Don Martín Miguel de Güemes", range(1950, 2016) ) self.assertHoliday( "2016-06-17", @@ -141,8 +140,7 @@ def test_independence_day(self): def test_san_martin_day(self): self.assertNoHolidayName( - "Paso a la Inmortalidad del General Don José de San Martin", - Argentina(years=1937), + "Paso a la Inmortalidad del General Don José de San Martin", Argentina(years=1937) ) self.assertNonObservedHoliday(f"{year}-08-17" for year in range(1938, 1995)) self.assertHoliday( @@ -213,10 +211,7 @@ def test_2022(self): ("2022-05-01", "Día del Trabajo"), ("2022-05-18", "Censo nacional 2022"), ("2022-05-25", "Día de la Revolución de Mayo"), - ( - "2022-06-17", - "Paso a la Inmortalidad del General Don Martín Miguel de Güemes", - ), + ("2022-06-17", "Paso a la Inmortalidad del General Don Martín Miguel de Güemes"), ("2022-06-20", "Paso a la Inmortalidad del General Don Manuel Belgrano"), ("2022-07-09", "Día de la Independencia"), ( @@ -244,10 +239,7 @@ def test_2023(self): ("2023-05-01", "Día del Trabajo"), ("2023-05-25", "Día de la Revolución de Mayo"), ("2023-05-26", "Feriado con fines turísticos"), - ( - "2023-06-17", - "Paso a la Inmortalidad del General Don Martín Miguel de Güemes", - ), + ("2023-06-17", "Paso a la Inmortalidad del General Don Martín Miguel de Güemes"), ("2023-06-19", "Feriado con fines turísticos"), ("2023-06-20", "Paso a la Inmortalidad del General Don Manuel Belgrano"), ("2023-07-09", "Día de la Independencia"), @@ -274,10 +266,7 @@ def test_2024(self): ("2024-04-02", "Día del Veterano y de los Caidos en la Guerra de Malvinas"), ("2024-05-01", "Día del Trabajo"), ("2024-05-25", "Día de la Revolución de Mayo"), - ( - "2024-06-17", - "Paso a la Inmortalidad del General Don Martín Miguel de Güemes", - ), + ("2024-06-17", "Paso a la Inmortalidad del General Don Martín Miguel de Güemes"), ("2024-06-20", "Paso a la Inmortalidad del General Don Manuel Belgrano"), ("2024-06-21", "Feriado con fines turísticos"), ("2024-07-09", "Día de la Independencia"), @@ -300,10 +289,7 @@ def test_l10n_default(self): ("2022-05-01", "Día del Trabajo"), ("2022-05-18", "Censo nacional 2022"), ("2022-05-25", "Día de la Revolución de Mayo"), - ( - "2022-06-17", - "Paso a la Inmortalidad del General Don Martín Miguel de Güemes", - ), + ("2022-06-17", "Paso a la Inmortalidad del General Don Martín Miguel de Güemes"), ("2022-06-20", "Paso a la Inmortalidad del General Don Manuel Belgrano"), ("2022-07-09", "Día de la Independencia"), ( @@ -331,16 +317,10 @@ def test_l10n_en_us(self): ("2022-05-01", "Labor Day"), ("2022-05-18", "National Census Day 2022"), ("2022-05-25", "May Revolution Day"), - ( - "2022-06-17", - "Pass to the Immortality of General Don Martín Miguel de Güemes", - ), + ("2022-06-17", "Pass to the Immortality of General Don Martín Miguel de Güemes"), ("2022-06-20", "Pass to the Immortality of General Don Manuel Belgrano"), ("2022-07-09", "Independence Day"), - ( - "2022-08-15", - "Pass to the Immortality of General Don José de San Martin (observed)", - ), + ("2022-08-15", "Pass to the Immortality of General Don José de San Martin (observed)"), ("2022-10-07", "Bridge Public Holiday"), ("2022-10-10", "Respect for Cultural Diversity Day (observed)"), ("2022-11-20", "National Sovereignty Day"), diff --git a/tests/countries/test_australia.py b/tests/countries/test_australia.py index f131aab48..845cfc62a 100644 --- a/tests/countries/test_australia.py +++ b/tests/countries/test_australia.py @@ -45,9 +45,7 @@ def test_new_years(self): for subdiv in Australia.subdivisions: self.assertHolidayName( - name, - self.subdiv_holidays[subdiv], - (f"{year}-01-01" for year in range(1900, 2050)), + name, self.subdiv_holidays[subdiv], (f"{year}-01-01" for year in range(1900, 2050)) ) self.assertHolidayName(f"{name} (observed)", self.subdiv_holidays[subdiv], obs_dt) self.assertNoNonObservedHoliday(Australia(subdiv=subdiv, observed=False), obs_dt) @@ -135,14 +133,10 @@ def test_australia_day(self): ) self.assertNoHolidayName(name_2, self.subdiv_holidays[subdiv], range(1900, 1935)) self.assertHolidayName( - name_1, - self.subdiv_holidays["NSW"], - (f"{year}-01-26" for year in range(1935, 1946)), + name_1, self.subdiv_holidays["NSW"], (f"{year}-01-26" for year in range(1935, 1946)) ) self.assertHolidayName( - name_2, - self.subdiv_holidays["NSW"], - (f"{year}-01-26" for year in range(1946, 2050)), + name_2, self.subdiv_holidays["NSW"], (f"{year}-01-26" for year in range(1946, 2050)) ) self.assertHolidayName(name_1, (f"{year}-01-26" for year in range(1900, 1935))) @@ -174,9 +168,7 @@ def test_anzac_day(self): self.assertNoHolidayName(name, range(1900, 1921)) for subdiv in Australia.subdivisions: self.assertHolidayName( - name, - self.subdiv_holidays[subdiv], - (f"{year}-04-25" for year in range(1921, 2050)), + name, self.subdiv_holidays[subdiv], (f"{year}-04-25" for year in range(1921, 2050)) ) self.assertNoHolidayName(name, self.subdiv_holidays[subdiv], range(1900, 1921)) @@ -208,9 +200,7 @@ def test_christmas_day(self): for subdiv in Australia.subdivisions: self.assertHolidayName( - name, - self.subdiv_holidays[subdiv], - (f"{year}-12-25" for year in range(1900, 2050)), + name, self.subdiv_holidays[subdiv], (f"{year}-12-25" for year in range(1900, 2050)) ) self.assertHolidayName(f"{name} (observed)", self.subdiv_holidays[subdiv], obs_dt) self.assertNoNonObservedHoliday(Australia(subdiv=subdiv, observed=False), obs_dt) @@ -233,9 +223,7 @@ def test_boxing_day(self): for subdiv in Australia.subdivisions: name = name_sa if subdiv == "SA" else name_common self.assertHolidayName( - name, - self.subdiv_holidays[subdiv], - (f"{year}-12-26" for year in range(1900, 2050)), + name, self.subdiv_holidays[subdiv], (f"{year}-12-26" for year in range(1900, 2050)) ) self.assertHolidayName(f"{name} (observed)", self.subdiv_holidays[subdiv], obs_dt) self.assertNoNonObservedHoliday(Australia(subdiv=subdiv, observed=False), obs_dt) @@ -359,9 +347,7 @@ def test_sovereigns_birthday(self): def test_canberra_day(self): name = "Canberra Day" self.assertHolidayName( - name, - self.subdiv_holidays["ACT"], - (f"{year}-03-12" for year in range(1913, 1958)), + name, self.subdiv_holidays["ACT"], (f"{year}-03-12" for year in range(1913, 1958)) ) dt = ( "1958-03-17", diff --git a/tests/countries/test_azerbaijan.py b/tests/countries/test_azerbaijan.py index 2510fafd4..297d2fdd6 100644 --- a/tests/countries/test_azerbaijan.py +++ b/tests/countries/test_azerbaijan.py @@ -81,8 +81,7 @@ def test_spring_festival(self): def test_victory_over_fascism_day(self): self.assertHolidayName( - "Faşizm üzərində qələbə günü", - (f"{year}-05-09" for year in range(1990, 2050)), + "Faşizm üzərində qələbə günü", (f"{year}-05-09" for year in range(1990, 2050)) ) def test_republic_day(self): @@ -296,10 +295,7 @@ def test_2022(self): ("2022-05-30", "Müstəqillik Günü (müşahidə olunur)"), ("2022-06-15", "Azərbaycan xalqının milli qurtuluş günü"), ("2022-06-26", "Azərbaycan Respublikasının Silahlı Qüvvələri günü"), - ( - "2022-06-27", - "Azərbaycan Respublikasının Silahlı Qüvvələri günü (müşahidə olunur)", - ), + ("2022-06-27", "Azərbaycan Respublikasının Silahlı Qüvvələri günü (müşahidə olunur)"), ("2022-07-09", "Qurban bayrami"), ("2022-07-10", "Qurban bayrami"), ("2022-07-11", "Qurban bayrami (müşahidə olunur)"), @@ -323,10 +319,7 @@ def test_l10n_default(self): self.assertLocalizedHolidays( ("2023-01-01", "Yeni il bayramı"), ("2023-01-02", "Yeni il bayramı"), - ( - "2023-01-03", - "Dünya azərbaycanlılarının həmrəyliyi günü (müşahidə olunur)", - ), + ("2023-01-03", "Dünya azərbaycanlılarının həmrəyliyi günü (müşahidə olunur)"), ("2023-01-04", "Yeni il bayramı (müşahidə olunur)"), ("2023-01-20", "Ümumxalq hüzn günü"), ("2023-03-08", "Qadınlar günü"), diff --git a/tests/countries/test_belize.py b/tests/countries/test_belize.py index 6abffa680..74796cf23 100644 --- a/tests/countries/test_belize.py +++ b/tests/countries/test_belize.py @@ -30,8 +30,7 @@ def test_new_years_day(self): name = "New Year's Day" years_observed = {1984, 1989, 1995, 2006, 2012, 2017, 2023, 2034, 2040, 2045} self.assertHolidayName( - name, - (f"{year}-01-01" for year in set(range(1982, 2050)).difference(years_observed)), + name, (f"{year}-01-01" for year in set(range(1982, 2050)).difference(years_observed)) ) self.assertHolidayName(f"{name} (observed)", (f"{year}-01-02" for year in years_observed)) @@ -39,8 +38,7 @@ def test_george_price_day(self): name = "George Price Day" years_observed = {2023, 2034, 2040, 2045} self.assertHolidayName( - name, - (f"{year}-01-15" for year in set(range(2021, 2050)).difference(years_observed)), + name, (f"{year}-01-15" for year in set(range(2021, 2050)).difference(years_observed)) ) self.assertHolidayName(f"{name} (observed)", (f"{year}-01-16" for year in years_observed)) self.assertNoHoliday(f"{year}-01-15" for year in range(1982, 2021)) @@ -95,8 +93,7 @@ def test_labour_day(self): name = "Labour Day" years_observed = {1983, 1988, 1994, 2005, 2011, 2016, 2022, 2033, 2039, 2044} self.assertHolidayName( - name, - (f"{year}-05-01" for year in set(range(1982, 2050)).difference(years_observed)), + name, (f"{year}-05-01" for year in set(range(1982, 2050)).difference(years_observed)) ) self.assertHolidayName(f"{name} (observed)", (f"{year}-05-02" for year in years_observed)) @@ -132,8 +129,7 @@ def test_saint_georges_caye_day(self): name = "Saint George's Caye Day" years_observed = {1989, 1995, 2000, 2006, 2017, 2023, 2028, 2034, 2045} self.assertHolidayName( - name, - (f"{year}-09-10" for year in set(range(1982, 2050)).difference(years_observed)), + name, (f"{year}-09-10" for year in set(range(1982, 2050)).difference(years_observed)) ) self.assertHolidayName(f"{name} (observed)", (f"{year}-09-11" for year in years_observed)) @@ -141,8 +137,7 @@ def test_independence_day(self): name = "Independence Day" years_observed = {1986, 1997, 2003, 2008, 2014, 2025, 2031, 2036, 2042} self.assertHolidayName( - name, - (f"{year}-09-21" for year in set(range(1982, 2050)).difference(years_observed)), + name, (f"{year}-09-21" for year in set(range(1982, 2050)).difference(years_observed)) ) self.assertHolidayName(f"{name} (observed)", (f"{year}-09-22" for year in years_observed)) @@ -175,8 +170,7 @@ def test_garifuna_settlement_day(self): name = "Garifuna Settlement Day" years_observed = {1989, 1995, 2000, 2006, 2017, 2023, 2028, 2034, 2045} self.assertHolidayName( - name, - (f"{year}-11-19" for year in set(range(1982, 2050)).difference(years_observed)), + name, (f"{year}-11-19" for year in set(range(1982, 2050)).difference(years_observed)) ) self.assertHolidayName(f"{name} (observed)", (f"{year}-11-20" for year in years_observed)) @@ -187,8 +181,7 @@ def test_boxing_day(self): name = "Boxing Day" years_observed = {1982, 1993, 1999, 2004, 2010, 2021, 2027, 2032, 2038, 2049} self.assertHolidayName( - name, - (f"{year}-12-26" for year in set(range(1982, 2050)).difference(years_observed)), + name, (f"{year}-12-26" for year in set(range(1982, 2050)).difference(years_observed)) ) self.assertHolidayName(f"{name} (observed)", (f"{year}-12-27" for year in years_observed)) diff --git a/tests/countries/test_bolivia.py b/tests/countries/test_bolivia.py index 282c00c77..5e6c0fc7a 100644 --- a/tests/countries/test_bolivia.py +++ b/tests/countries/test_bolivia.py @@ -269,10 +269,7 @@ def test_l10n_default(self): ("2023-01-01", "Año Nuevo"), ("2023-01-02", "Año Nuevo (observado)"), ("2023-01-22", "Día de la Creación del Estado Plurinacional de Bolivia"), - ( - "2023-01-23", - "Día de la Creación del Estado Plurinacional de Bolivia (observado)", - ), + ("2023-01-23", "Día de la Creación del Estado Plurinacional de Bolivia (observado)"), ("2023-02-20", "Carnaval"), ("2023-02-21", "Carnaval"), ("2023-04-07", "Viernes Santo"), @@ -312,10 +309,7 @@ def test_l10n_uk(self): ("2023-01-01", "Новий рік"), ("2023-01-02", "Новий рік (вихідний)"), ("2023-01-22", "День створення Багатонаціональної Держави Болівія"), - ( - "2023-01-23", - "День створення Багатонаціональної Держави Болівія (вихідний)", - ), + ("2023-01-23", "День створення Багатонаціональної Держави Болівія (вихідний)"), ("2023-02-20", "Карнавал"), ("2023-02-21", "Карнавал"), ("2023-04-07", "Страсна пʼятниця"), diff --git a/tests/countries/test_bosnia_and_herzegovina.py b/tests/countries/test_bosnia_and_herzegovina.py index 9b40dc5ee..4f778161b 100644 --- a/tests/countries/test_bosnia_and_herzegovina.py +++ b/tests/countries/test_bosnia_and_herzegovina.py @@ -469,10 +469,7 @@ def test_2021(self): ("2021-05-14", "Ramazanski Bajram"), ("2021-07-20", "Kurban Bajram"), ("2021-07-21", "Kurban Bajram"), - ( - "2021-11-21", - "Dan uspostave Opšteg okvirnog sporazuma za mir u Bosni i Hercegovini", - ), + ("2021-11-21", "Dan uspostave Opšteg okvirnog sporazuma za mir u Bosni i Hercegovini"), ("2021-12-24", "Badnji dan (Katolički)"), ("2021-12-25", "Božić (Katolički)"), ) diff --git a/tests/countries/test_bulgaria.py b/tests/countries/test_bulgaria.py index 70fcb350a..5ef3cd1ce 100644 --- a/tests/countries/test_bulgaria.py +++ b/tests/countries/test_bulgaria.py @@ -226,15 +226,9 @@ def test_l10n_en_us(self): ("2022-04-24", "Easter"), ("2022-04-25", "Easter"), ("2022-05-01", "Labor Day and International Workers' Solidarity Day"), - ( - "2022-05-02", - "Labor Day and International Workers' Solidarity Day (observed)", - ), + ("2022-05-02", "Labor Day and International Workers' Solidarity Day (observed)"), ("2022-05-06", "St. George's Day (Day of the Bulgarian Army)"), - ( - "2022-05-24", - "Day of Slavonic Alphabet, Bulgarian Enlightenment and Culture", - ), + ("2022-05-24", "Day of Slavonic Alphabet, Bulgarian Enlightenment and Culture"), ("2022-09-06", "Unification Day"), ("2022-09-22", "Independence Day"), ("2022-11-01", "The Day of the People's Awakeners"), @@ -256,14 +250,8 @@ def test_l10n_uk(self): ("2022-04-24", "Великдень"), ("2022-04-25", "Великдень"), ("2022-05-01", "День праці та міжнародної солідарності трудящих"), - ( - "2022-05-02", - "День праці та міжнародної солідарності трудящих (вихідний)", - ), - ( - "2022-05-06", - "День Святого Георгія та День хоробрості і болгарської армії", - ), + ("2022-05-02", "День праці та міжнародної солідарності трудящих (вихідний)"), + ("2022-05-06", "День Святого Георгія та День хоробрості і болгарської армії"), ( "2022-05-24", "День святих братів Кирила і Мефодія, болгарської писемності, " diff --git a/tests/countries/test_burundi.py b/tests/countries/test_burundi.py index e3bde38a6..9d03451aa 100644 --- a/tests/countries/test_burundi.py +++ b/tests/countries/test_burundi.py @@ -74,8 +74,7 @@ def test_assumption_Day(self): def test_rwagasore_day(self): self.assertHolidayName( - "Prince Louis Rwagasore Day", - (f"{year}-10-13" for year in range(1962, 2050)), + "Prince Louis Rwagasore Day", (f"{year}-10-13" for year in range(1962, 2050)) ) def test_ndadaye_day(self): diff --git a/tests/countries/test_canada.py b/tests/countries/test_canada.py index d7c11360f..35c4897a3 100644 --- a/tests/countries/test_canada.py +++ b/tests/countries/test_canada.py @@ -252,9 +252,7 @@ def test_national_day_for_truth_and_reconciliation(self): for prov, holidays in self.prov_hols.items(): if prov in {"BC", "NT", "NU", "PE", "YT"}: self.assertHolidayName( - name, - holidays, - (f"{year}-09-30" for year in range(start_years[prov], 2050)), + name, holidays, (f"{year}-09-30" for year in range(start_years[prov], 2050)) ) self.assertNoHolidayName(name, holidays, range(1867, start_years[prov])) else: @@ -324,9 +322,7 @@ def test_remembrance_day(self): if prov in {"AB", "BC", "NB", "NL", "NS", "NT", "NU", "PE", "SK", "YT"}: start_year = 1981 if prov == "NS" else 1931 self.assertHolidayName( - name, - holidays, - (f"{year}-11-11" for year in range(start_year, 2050)), + name, holidays, (f"{year}-11-11" for year in range(start_year, 2050)) ) self.assertNoHoliday( holidays, (f"{year}-11-11" for year in range(1900, start_year)) diff --git a/tests/countries/test_chile.py b/tests/countries/test_chile.py index e913324f7..03612cc71 100644 --- a/tests/countries/test_chile.py +++ b/tests/countries/test_chile.py @@ -195,8 +195,7 @@ def test_national_unity(self): ) self.assertNoHolidayName( - "Día de la Unidad Nacional", - set(range(1915, 2050)).difference({1999, 2000, 2001}), + "Día de la Unidad Nacional", set(range(1915, 2050)).difference({1999, 2000, 2001}) ) def test_independence_holidays(self): diff --git a/tests/countries/test_costa_rica.py b/tests/countries/test_costa_rica.py index 340350a5a..d27d1e481 100644 --- a/tests/countries/test_costa_rica.py +++ b/tests/countries/test_costa_rica.py @@ -257,10 +257,7 @@ def test_optional_2022(self): self.assertHolidays( CostaRica(categories=OPTIONAL, years=2022), ("2022-08-02", "Fiesta de Nuestra Señora de los Ángeles"), - ( - "2022-09-04", - "Día de la Persona Negra y la Cultura Afrocostarricense (observado)", - ), + ("2022-09-04", "Día de la Persona Negra y la Cultura Afrocostarricense (observado)"), ("2022-12-05", "Día de la Abolición del Ejército (observado)"), ) @@ -282,10 +279,7 @@ def test_optional_2023(self): self.assertHolidays( CostaRica(categories=OPTIONAL, years=2023), ("2023-08-02", "Fiesta de Nuestra Señora de los Ángeles"), - ( - "2023-09-03", - "Día de la Persona Negra y la Cultura Afrocostarricense (observado)", - ), + ("2023-09-03", "Día de la Persona Negra y la Cultura Afrocostarricense (observado)"), ("2023-12-01", "Día de la Abolición del Ejército"), ) @@ -299,10 +293,7 @@ def test_l10n_default(self): ("2022-07-25", "Anexión del Partido de Nicoya a Costa Rica"), ("2022-08-02", "Fiesta de Nuestra Señora de los Ángeles"), ("2022-08-15", "Día de la Madre"), - ( - "2022-09-04", - "Día de la Persona Negra y la Cultura Afrocostarricense (observado)", - ), + ("2022-09-04", "Día de la Persona Negra y la Cultura Afrocostarricense (observado)"), ("2022-09-19", "Día de la Independencia (observado)"), ("2022-12-05", "Día de la Abolición del Ejército (observado)"), ("2022-12-25", "Navidad"), @@ -319,10 +310,7 @@ def test_l10n_en_us(self): ("2022-07-25", "Annexation of the Party of Nicoya to Costa Rica"), ("2022-08-02", "Feast of Our Lady of the Angels"), ("2022-08-15", "Mother's Day"), - ( - "2022-09-04", - "Day of the Black Person and Afro-Costa Rican Culture (observed)", - ), + ("2022-09-04", "Day of the Black Person and Afro-Costa Rican Culture (observed)"), ("2022-09-19", "Independence Day (observed)"), ("2022-12-05", "Army Abolition Day (observed)"), ("2022-12-25", "Christmas Day"), @@ -339,10 +327,7 @@ def test_l10n_uk(self): ("2022-07-25", "День приєднання Нікої"), ("2022-08-02", "Свято Богоматері Ангелів"), ("2022-08-15", "День матері"), - ( - "2022-09-04", - "День чорношкірої людини та афро-костариканської культури (вихідний)", - ), + ("2022-09-04", "День чорношкірої людини та афро-костариканської культури (вихідний)"), ("2022-09-19", "День незалежності (вихідний)"), ("2022-12-05", "День ліквідації армії (вихідний)"), ("2022-12-25", "Різдво Христове"), diff --git a/tests/countries/test_croatia.py b/tests/countries/test_croatia.py index 28f90a636..bb9345c09 100644 --- a/tests/countries/test_croatia.py +++ b/tests/countries/test_croatia.py @@ -32,8 +32,7 @@ def test_new_years_day(self): def test_epiphany(self): name = "Bogojavljenje ili Sveta tri kralja" self.assertHolidayName( - name, - (f"{year}-01-06" for year in set(range(1992, 2050)).difference({2002})), + name, (f"{year}-01-06" for year in set(range(1992, 2050)).difference({2002})) ) self.assertNoHoliday("2002-01-06") self.assertNoHolidayName(name, 2002) @@ -132,10 +131,7 @@ def test_l10n_default(self): ("2022-05-30", "Dan državnosti"), ("2022-06-16", "Tijelovo"), ("2022-06-22", "Dan antifašističke borbe"), - ( - "2022-08-05", - "Dan pobjede i domovinske zahvalnosti i Dan hrvatskih branitelja", - ), + ("2022-08-05", "Dan pobjede i domovinske zahvalnosti i Dan hrvatskih branitelja"), ("2022-08-15", "Velika Gospa"), ("2022-11-01", "Svi sveti"), ( @@ -158,10 +154,7 @@ def test_l10n_en_us(self): ("2022-05-30", "Statehood Day"), ("2022-06-16", "Corpus Christi"), ("2022-06-22", "Anti-Fascist Struggle Day"), - ( - "2022-08-05", - "Victory and Homeland Thanksgiving Day and Croatian Veterans Day", - ), + ("2022-08-05", "Victory and Homeland Thanksgiving Day and Croatian Veterans Day"), ("2022-08-15", "Assumption Day"), ("2022-11-01", "All Saints' Day"), ("2022-11-18", "Remembrance Day"), @@ -180,16 +173,10 @@ def test_l10n_uk(self): ("2022-05-30", "День державності"), ("2022-06-16", "Свято Тіла і Крові Христових"), ("2022-06-22", "День антифашистської боротьби"), - ( - "2022-08-05", - "День перемоги і подяки вітчизні та День хорватських захисників", - ), + ("2022-08-05", "День перемоги і подяки вітчизні та День хорватських захисників"), ("2022-08-15", "Внебовзяття Пресвятої Діви Марії"), ("2022-11-01", "День усіх святих"), - ( - "2022-11-18", - "День памʼяті жертв Вітчизняної війни та жертв Вуковара і Шкабрні", - ), + ("2022-11-18", "День памʼяті жертв Вітчизняної війни та жертв Вуковара і Шкабрні"), ("2022-12-25", "Різдво Христове"), ("2022-12-26", "День Святого Стефана"), ) diff --git a/tests/countries/test_cuba.py b/tests/countries/test_cuba.py index ce34d32f8..0b9d6e33c 100644 --- a/tests/countries/test_cuba.py +++ b/tests/countries/test_cuba.py @@ -33,8 +33,7 @@ def test_assault_moncada_day(self): def test_national_rebellion_day(self): self.assertHolidayName( - "Día de la Rebeldía Nacional", - (f"{year}-07-26" for year in range(1959, 2050)), + "Día de la Rebeldía Nacional", (f"{year}-07-26" for year in range(1959, 2050)) ) def test_independence_day(self): diff --git a/tests/countries/test_ecuador.py b/tests/countries/test_ecuador.py index 092636903..8937e15e6 100644 --- a/tests/countries/test_ecuador.py +++ b/tests/countries/test_ecuador.py @@ -70,14 +70,12 @@ def test_battle_of_pichincha(self): def test_independence_of_quito(self): self.assertHolidayName( - "Primer Grito de Independencia", - (f"{year}-08-10" for year in range(2000, 2050)), + "Primer Grito de Independencia", (f"{year}-08-10" for year in range(2000, 2050)) ) def test_independence_of_guayaquil(self): self.assertHolidayName( - "Independencia de Guayaquil", - (f"{year}-10-09" for year in range(2000, 2050)), + "Independencia de Guayaquil", (f"{year}-10-09" for year in range(2000, 2050)) ) def test_all_souls_day(self): @@ -156,10 +154,7 @@ def test_2022(self): ("2022-10-10", "Independencia de Guayaquil (observado)"), ("2022-11-02", "Día de los Difuntos"), ("2022-11-03", "Independencia de Cuenca"), - ( - "2022-11-04", - "Día de los Difuntos (observado); Independencia de Cuenca (observado)", - ), + ("2022-11-04", "Día de los Difuntos (observado); Independencia de Cuenca (observado)"), ("2022-12-25", "Día de Navidad"), ("2022-12-26", "Día de Navidad (observado)"), ) @@ -194,10 +189,7 @@ def test_l10n_default(self): ("2022-10-10", "Independencia de Guayaquil (observado)"), ("2022-11-02", "Día de los Difuntos"), ("2022-11-03", "Independencia de Cuenca"), - ( - "2022-11-04", - "Día de los Difuntos (observado); Independencia de Cuenca (observado)", - ), + ("2022-11-04", "Día de los Difuntos (observado); Independencia de Cuenca (observado)"), ("2022-12-25", "Día de Navidad"), ("2022-12-26", "Día de Navidad (observado)"), ) @@ -219,10 +211,7 @@ def test_l10n_en_us(self): ("2022-10-10", "Independence of Guayaquil (observed)"), ("2022-11-02", "All Souls' Day"), ("2022-11-03", "Independence of Cuenca"), - ( - "2022-11-04", - "All Souls' Day (observed); Independence of Cuenca (observed)", - ), + ("2022-11-04", "All Souls' Day (observed); Independence of Cuenca (observed)"), ("2022-12-25", "Christmas Day"), ("2022-12-26", "Christmas Day (observed)"), ) @@ -244,10 +233,7 @@ def test_l10n_uk(self): ("2022-10-10", "День незалежності Гуаякіля (вихідний)"), ("2022-11-02", "День усіх померлих"), ("2022-11-03", "День незалежності Куенки"), - ( - "2022-11-04", - "День незалежності Куенки (вихідний); День усіх померлих (вихідний)", - ), + ("2022-11-04", "День незалежності Куенки (вихідний); День усіх померлих (вихідний)"), ("2022-12-25", "Різдво Христове"), ("2022-12-26", "Різдво Христове (вихідний)"), ) diff --git a/tests/countries/test_germany.py b/tests/countries/test_germany.py index d78037420..2e9d61007 100644 --- a/tests/countries/test_germany.py +++ b/tests/countries/test_germany.py @@ -102,13 +102,11 @@ def test_heilige_drei_koenige(self): for province in provinces_that_have: self.assertHoliday( - self.prov_hols[province], - (f"{year}-01-06" for year in range(1991, 2050)), + self.prov_hols[province], (f"{year}-01-06" for year in range(1991, 2050)) ) for province in provinces_that_dont: self.assertNoHoliday( - self.prov_hols[province], - (f"{year}-01-06" for year in range(1991, 2050)), + self.prov_hols[province], (f"{year}-01-06" for year in range(1991, 2050)) ) def test_karfreitag(self): @@ -212,14 +210,12 @@ def test_frauentag(self): for province in set(DE.subdivisions): self.assertNoHoliday( - self.prov_hols[province], - (f"{year}-03-08" for year in range(1991, 2019)), + self.prov_hols[province], (f"{year}-03-08" for year in range(1991, 2019)) ) self.assertNoHoliday(self.prov_hols["MV"], (f"{year}-03-08" for year in range(2019, 2023))) for province in set(DE.subdivisions) - {"BE", "MV"}: self.assertNoHoliday( - self.prov_hols[province], - (f"{year}-03-08" for year in range(2023, 2050)), + self.prov_hols[province], (f"{year}-03-08" for year in range(2023, 2050)) ) def test_pfingstsonntag(self): @@ -290,13 +286,11 @@ def test_mariae_himmelfahrt(self): for province in provinces_that_have: self.assertHoliday( - self.prov_hols[province], - (f"{year}-08-15" for year in range(1991, 2050)), + self.prov_hols[province], (f"{year}-08-15" for year in range(1991, 2050)) ) for province in provinces_that_dont: self.assertNoHoliday( - self.prov_hols[province], - (f"{year}-08-15" for year in range(1991, 2050)), + self.prov_hols[province], (f"{year}-08-15" for year in range(1991, 2050)) ) def test_reformationstag(self): @@ -307,26 +301,22 @@ def test_reformationstag(self): for province in prov_yes: self.assertHoliday( - self.prov_hols[province], - (f"{year}-10-31" for year in range(1991, 2050)), + self.prov_hols[province], (f"{year}-10-31" for year in range(1991, 2050)) ) for province in prov_yes_since_2018: self.assertHoliday( - self.prov_hols[province], - (f"{year}-10-31" for year in range(2018, 2050)), + self.prov_hols[province], (f"{year}-10-31" for year in range(2018, 2050)) ) for province in DE.subdivisions: self.assertHoliday(self.prov_hols[province], "2017-10-31") for province in prov_not: self.assertNoHoliday( - self.prov_hols[province], - (f"{year}-10-31" for year in range(1991, 2017)), + self.prov_hols[province], (f"{year}-10-31" for year in range(1991, 2017)) ) for province in prov_not_since_2018: self.assertNoHoliday( - self.prov_hols[province], - (f"{year}-10-31" for year in range(2018, 2050)), + self.prov_hols[province], (f"{year}-10-31" for year in range(2018, 2050)) ) def test_allerheiligen(self): @@ -335,13 +325,11 @@ def test_allerheiligen(self): for province in provinces_that_have: self.assertHoliday( - self.prov_hols[province], - (f"{year}-11-01" for year in range(1991, 2050)), + self.prov_hols[province], (f"{year}-11-01" for year in range(1991, 2050)) ) for province in provinces_that_dont: self.assertNoHoliday( - self.prov_hols[province], - (f"{year}-11-01" for year in range(1991, 2050)), + self.prov_hols[province], (f"{year}-11-01" for year in range(1991, 2050)) ) def test_buss_und_bettag(self): diff --git a/tests/countries/test_hongkong.py b/tests/countries/test_hongkong.py index 32ba0da0e..425fa642f 100644 --- a/tests/countries/test_hongkong.py +++ b/tests/countries/test_hongkong.py @@ -251,8 +251,7 @@ def test_labour_day(self): name = "Labour Day" name_following = f"The day following {name}" self.assertHolidayName( - name, - (f"{year}-05-01" for year in set(range(1999, 2024)).difference(exception_years)), + name, (f"{year}-05-01" for year in set(range(1999, 2024)).difference(exception_years)) ) self.assertHolidayName(name_following, (f"{year}-05-02" for year in exception_years)) self.assertNoHolidayName(name, 1998) @@ -287,8 +286,7 @@ def test_hksar_day(self): name = "Hong Kong Special Administrative Region Establishment Day" name_following = f"The day following {name}" self.assertHolidayName( - name, - (f"{year}-07-01" for year in set(range(1997, 2024)).difference(exception_years)), + name, (f"{year}-07-01" for year in set(range(1997, 2024)).difference(exception_years)) ) self.assertHolidayName(name_following, (f"{year}-07-02" for year in exception_years)) self.assertNoHolidayName(name, 1996) @@ -333,8 +331,7 @@ def test_national_day(self): name = "National Day" name_following = f"The day following {name}" self.assertHolidayName( - name, - (f"{year}-10-01" for year in set(range(1997, 2024)).difference(exception_years)), + name, (f"{year}-10-01" for year in set(range(1997, 2024)).difference(exception_years)) ) self.assertHolidayName(name, "1997-10-02", "1998-10-02") self.assertHolidayName(name_following, (f"{year}-10-02" for year in exception_years)) @@ -372,16 +369,14 @@ def test_christmas_day(self): exception_years = {2011, 2016, 2022} name = "Christmas Day" self.assertHolidayName( - name, - (f"{year}-12-25" for year in set(range(2006, 2024)).difference(exception_years)), + name, (f"{year}-12-25" for year in set(range(2006, 2024)).difference(exception_years)) ) self.assertNoHolidayName(name, exception_years) exception_years = {2010, 2021} name = "The first weekday after Christmas Day" self.assertHolidayName( - name, - (f"{year}-12-26" for year in set(range(2006, 2024)).difference(exception_years)), + name, (f"{year}-12-26" for year in set(range(2006, 2024)).difference(exception_years)) ) self.assertHolidayName(name, (f"{year}-12-27" for year in exception_years)) diff --git a/tests/countries/test_hungary.py b/tests/countries/test_hungary.py index d99ad1225..4955b95b3 100644 --- a/tests/countries/test_hungary.py +++ b/tests/countries/test_hungary.py @@ -30,8 +30,7 @@ def test_national_day_march(self): name = "Nemzeti ünnep" years_absent = set(range(1951, 1989)) self.assertHolidayName( - name, - (f"{year}-03-15" for year in set(range(1945, 2050)).difference(years_absent)), + name, (f"{year}-03-15" for year in set(range(1945, 2050)).difference(years_absent)) ) self.assertNoHoliday(f"{year}-03-15" for year in years_absent) self.assertNoHolidayName(name, years_absent) @@ -154,8 +153,7 @@ def test_christmas(self): name = "Karácsony másnapja" self.assertHolidayName( - name, - (f"{year}-12-26" for year in set(range(1945, 2050)).difference({1955})), + name, (f"{year}-12-26" for year in set(range(1945, 2050)).difference({1955})) ) self.assertNoHoliday("1955-12-26") self.assertNoHolidayName(name, 1955) diff --git a/tests/countries/test_italy.py b/tests/countries/test_italy.py index 9a115c461..5ba7ab262 100644 --- a/tests/countries/test_italy.py +++ b/tests/countries/test_italy.py @@ -185,8 +185,7 @@ def test_province_specific_days(self): def test_deprecated(self): self.assertEqual( - Italy(subdiv="Forlì", years=2022).keys(), - Italy(subdiv="Forli", years=2022).keys(), + Italy(subdiv="Forlì", years=2022).keys(), Italy(subdiv="Forli", years=2022).keys() ) def test_subdiv_deprecation(self): diff --git a/tests/countries/test_laos.py b/tests/countries/test_laos.py index f7716abb2..af0d34021 100644 --- a/tests/countries/test_laos.py +++ b/tests/countries/test_laos.py @@ -407,10 +407,7 @@ def test_l10n_en_US(self): ("2022-02-16", "Makha Bousa Festival"), ("2022-03-08", "International Women's Rights Day"), ("2022-03-22", "Establishment Day of the Lao People's Revolutionary Party"), - ( - "2022-04-14", - "Lao New Year's Day; Lao People's Revolutionary Youth Union Day", - ), + ("2022-04-14", "Lao New Year's Day; Lao People's Revolutionary Youth Union Day"), ("2022-04-15", "Lao New Year's Day"), ("2022-04-16", "Lao New Year's Day"), ("2022-04-18", "Lao New Year's Day (in lieu)"), diff --git a/tests/countries/test_lithuania.py b/tests/countries/test_lithuania.py index 6584b5ceb..7eb51a8bc 100644 --- a/tests/countries/test_lithuania.py +++ b/tests/countries/test_lithuania.py @@ -33,8 +33,7 @@ def test_new_years(self): def test_restoration_of_state_day(self): self.assertHolidayName( - "Lietuvos valstybės atkūrimo diena", - (f"{year}-02-16" for year in range(1990, 2050)), + "Lietuvos valstybės atkūrimo diena", (f"{year}-02-16" for year in range(1990, 2050)) ) def test_restoration_of_independence_day(self): @@ -95,7 +94,7 @@ def test_dew_and_saint_john_day(self): self.assertNoHolidayName(name, range(1990, 2003)) def test_statehood_day(self): - name = "Valstybės (Lietuvos karaliaus Mindaugo karūnavimo) ir Tautiškos giesmės diena" + name = "Valstybės (Lietuvos karaliaus Mindaugo karūnavimo) " "ir Tautiškos giesmės diena" self.assertHolidayName(name, (f"{year}-07-06" for year in range(1991, 2050))) self.assertNoHoliday(f"{year}-07-06" for year in range(1990, 1991)) self.assertNoHolidayName(name, range(1990, 1991)) diff --git a/tests/countries/test_malaysia.py b/tests/countries/test_malaysia.py index 88c1234be..cc9d16982 100644 --- a/tests/countries/test_malaysia.py +++ b/tests/countries/test_malaysia.py @@ -1324,9 +1324,6 @@ def test_2024(self): ("2024-08-31", "National Day"), ("2024-04-10", "Hari Raya Puasa"), ("2024-06-17", "Hari Raya Haji"), - ( - "2024-09-16", - "Malaysia Day; Maulidur Rasul (Birthday of the Prophet Muhammad)", - ), + ("2024-09-16", "Malaysia Day; Maulidur Rasul (Birthday of the Prophet Muhammad)"), ("2024-02-12", "Chinese New Year Holiday (in lieu)"), ) diff --git a/tests/countries/test_namibia.py b/tests/countries/test_namibia.py index d60309a73..0a8d73dec 100644 --- a/tests/countries/test_namibia.py +++ b/tests/countries/test_namibia.py @@ -46,12 +46,10 @@ def test_holidays(self): f"{year}-12-26", ) self.assertNoHolidayName( - "Day of the Namibian Women and International Human Rights Day", - range(1990, 2005), + "Day of the Namibian Women and International Human Rights Day", range(1990, 2005) ) self.assertHolidayName( - "International Human Rights Day", - (f"{year}-09-10" for year in range(1990, 2005)), + "International Human Rights Day", (f"{year}-09-10" for year in range(1990, 2005)) ) def test_easter(self): diff --git a/tests/countries/test_papua_new_guinea.py b/tests/countries/test_papua_new_guinea.py index 24502c0e9..ec12db286 100644 --- a/tests/countries/test_papua_new_guinea.py +++ b/tests/countries/test_papua_new_guinea.py @@ -19,9 +19,7 @@ class TestPapuaNewGuinea(CommonCountryTests, TestCase): @classmethod def setUpClass(cls): super().setUpClass( - PapuaNewGuinea, - years=range(1953, 2050), - years_non_observed=range(1953, 2050), + PapuaNewGuinea, years=range(1953, 2050), years_non_observed=range(1953, 2050) ) def test_country_aliases(self): diff --git a/tests/countries/test_paraguay.py b/tests/countries/test_paraguay.py index d7635993f..d9d352ffb 100644 --- a/tests/countries/test_paraguay.py +++ b/tests/countries/test_paraguay.py @@ -40,8 +40,7 @@ def test_patriots_day(self): name = "Día de los Héroes de la Patria" years_excluded = {2013, 2016, 2018, 2022} self.assertHolidayName( - name, - (f"{year}-03-01" for year in set(range(1990, 2050)).difference(years_excluded)), + name, (f"{year}-03-01" for year in set(range(1990, 2050)).difference(years_excluded)) ) self.assertNoHolidayName(name, (f"{year}-03-01" for year in years_excluded)) self.assertHolidayName( @@ -117,8 +116,7 @@ def test_chaco_armistice_day(self): name = "Día de la Paz del Chaco" years_excluded = {2014, 2018} self.assertHolidayName( - name, - (f"{year}-06-12" for year in set(range(1990, 2050)).difference(years_excluded)), + name, (f"{year}-06-12" for year in set(range(1990, 2050)).difference(years_excluded)) ) self.assertNoHolidayName(name, (f"{year}-06-12" for year in years_excluded)) self.assertHolidayName( @@ -138,8 +136,7 @@ def test_chaco_armistice_day(self): def test_asuncion_foundations_day(self): self.assertHolidayName( - "Día de la Fundación de Asunción", - (f"{year}-08-15" for year in range(1990, 2050)), + "Día de la Fundación de Asunción", (f"{year}-08-15" for year in range(1990, 2050)) ) self.assertNoNonObservedHoliday( "2004-08-15", @@ -154,8 +151,7 @@ def test_boqueron_battle_day(self): name = "Día de la Batalla de Boquerón" years_excluded = {2015, 2016, 2017, 2021, 2022} self.assertHolidayName( - name, - (f"{year}-09-29" for year in set(range(2000, 2050)).difference(years_excluded)), + name, (f"{year}-09-29" for year in set(range(2000, 2050)).difference(years_excluded)) ) self.assertNoHolidayName(name, (f"{year}-09-29" for year in years_excluded)) self.assertNoHolidayName(name, (f"{year}-09-29" for year in range(1990, 2000))) @@ -180,8 +176,7 @@ def test_boqueron_battle_day(self): def test_caacupe_virgin_day(self): self.assertHolidayName( - "Día de la Virgen de Caacupé", - (f"{year}-12-08" for year in range(1990, 2050)), + "Día de la Virgen de Caacupé", (f"{year}-12-08" for year in range(1990, 2050)) ) self.assertNoNonObservedHoliday( "2001-12-08", diff --git a/tests/countries/test_poland.py b/tests/countries/test_poland.py index 89fc2b21d..db7d28b72 100644 --- a/tests/countries/test_poland.py +++ b/tests/countries/test_poland.py @@ -140,9 +140,7 @@ def test_narodowe_swieto_zwyciestwa_i_wolnosci(self): self.assertNoHoliday(f"{year}-05-09" for year in range(1925, 1946)) 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), + "Narodowe Święto Zwycięstwa i Wolności", range(1925, 1946), range(1951, 2050) ) def test_wniebowstapienie_panskie(self): diff --git a/tests/countries/test_russia.py b/tests/countries/test_russia.py index 39f79dcf3..27a10b566 100644 --- a/tests/countries/test_russia.py +++ b/tests/countries/test_russia.py @@ -69,8 +69,7 @@ def test_defender_of_fatherland_day(self): def test_international_womens_day(self): self.assertHolidayName( - "Международный женский день", - (f"{year}-03-08" for year in range(1991, 2025)), + "Международный женский день", (f"{year}-03-08" for year in range(1991, 2025)) ) def test_labor_day(self): diff --git a/tests/countries/test_slovakia.py b/tests/countries/test_slovakia.py index 8d95e57e8..5498bb96d 100644 --- a/tests/countries/test_slovakia.py +++ b/tests/countries/test_slovakia.py @@ -34,8 +34,7 @@ def test_special_holidays(self): def test_new_years_day(self): self.assertHolidayName( - "Deň vzniku Slovenskej republiky", - (f"{year}-01-01" for year in range(1993, 2050)), + "Deň vzniku Slovenskej republiky", (f"{year}-01-01" for year in range(1993, 2050)) ) def test_epiphany(self): @@ -87,8 +86,7 @@ def test_slovak_national_uprising(self): def test_constitution_day(self): self.assertHolidayName( - "Deň Ústavy Slovenskej republiky", - (f"{year}-09-01" for year in range(1993, 2050)), + "Deň Ústavy Slovenskej republiky", (f"{year}-09-01" for year in range(1993, 2050)) ) def test_day_of_our_lady_of_the_seven_sorrows(self): @@ -192,10 +190,7 @@ def test_l10n_en_us(self): ("2022-08-29", "Slovak National Uprising Anniversary"), ("2022-09-01", "Constitution Day"), ("2022-09-15", "Day of Our Lady of the Seven Sorrows"), - ( - "2022-10-28", - "Day of the Establishment of the Independent Czech-Slovak State", - ), + ("2022-10-28", "Day of the Establishment of the Independent Czech-Slovak State"), ("2022-11-01", "All Saints' Day"), ("2022-11-17", "Struggle for Freedom and Democracy Day"), ("2022-12-24", "Christmas Eve"), diff --git a/tests/countries/test_slovenia.py b/tests/countries/test_slovenia.py index 03c4e13d9..e743364cc 100644 --- a/tests/countries/test_slovenia.py +++ b/tests/countries/test_slovenia.py @@ -54,8 +54,7 @@ def test_easter_monday(self): def test_uprising_against_occupation_day(self): self.assertHolidayName( - "dan upora proti okupatorju", - (f"{year}-04-27" for year in range(1991, 2050)), + "dan upora proti okupatorju", (f"{year}-04-27" for year in range(1991, 2050)) ) def test_labor_day(self): @@ -86,8 +85,7 @@ def test_christmas_day(self): def test_independence_and_unity_day(self): self.assertHolidayName( - "dan samostojnosti in enotnosti", - (f"{year}-12-26" for year in range(1991, 2050)), + "dan samostojnosti in enotnosti", (f"{year}-12-26" for year in range(1991, 2050)) ) def test_l10n_default(self): diff --git a/tests/countries/test_spain.py b/tests/countries/test_spain.py index 67541b125..89d50a8ff 100644 --- a/tests/countries/test_spain.py +++ b/tests/countries/test_spain.py @@ -239,19 +239,7 @@ def test_islamic(self): def test_variable_holidays_2010(self): province_days = { (MAR, 1): {"AN", "IB"}, - (MAR, 19): { - "CL", - "CM", - "EX", - "GA", - "MC", - "MD", - "ML", - "NC", - "PV", - "RI", - "VC", - }, + (MAR, 19): {"CL", "CM", "EX", "GA", "MC", "MD", "ML", "NC", "PV", "RI", "VC"}, (APR, 1): { "AN", "AR", @@ -330,19 +318,7 @@ def test_variable_holidays_2011(self): (SEP, 15): {"CB"}, (OCT, 25): {"PV"}, (NOV, 7): {"CE", "ML"}, - (DEC, 26): { - "AN", - "AR", - "AS", - "CE", - "CL", - "CN", - "CT", - "EX", - "IB", - "ML", - "NC", - }, + (DEC, 26): {"AN", "AR", "AS", "CE", "CL", "CN", "CT", "EX", "IB", "ML", "NC"}, } self._assertVariableDays(2011, province_days) @@ -533,20 +509,7 @@ def test_variable_holidays_2015(self): (SEP, 25): {"CE", "ML"}, (OCT, 9): {"VC"}, (NOV, 2): {"AN", "AR", "AS", "CB", "CE", "CL", "CN", "EX", "GA", "IB"}, - (DEC, 7): { - "AN", - "AR", - "AS", - "CE", - "CL", - "CM", - "EX", - "IB", - "MC", - "ML", - "RI", - "VC", - }, + (DEC, 7): {"AN", "AR", "AS", "CE", "CL", "CM", "EX", "IB", "MC", "ML", "RI", "VC"}, (DEC, 26): {"CT"}, } self._assertVariableDays(2015, province_days) @@ -703,19 +666,7 @@ def test_variable_holidays_2018(self): def test_variable_holidays_2019(self): province_days = { - (JAN, 7): { - "AN", - "AR", - "AS", - "CE", - "CL", - "CN", - "EX", - "MC", - "MD", - "ML", - "NC", - }, + (JAN, 7): {"AN", "AR", "AS", "CE", "CL", "CN", "EX", "MC", "MD", "ML", "NC"}, (FEB, 28): {"AN"}, (MAR, 1): {"IB"}, (MAR, 19): {"GA", "MC", "NC", "PV", "VC"}, diff --git a/tests/countries/test_switzerland.py b/tests/countries/test_switzerland.py index 3edc0bf6a..d3c52e4a3 100644 --- a/tests/countries/test_switzerland.py +++ b/tests/countries/test_switzerland.py @@ -628,19 +628,7 @@ def test_saint_stephens_day(self): self.assertNoHolidayName(name, holidays) # When holiday present in NE. - ne_years_have = { - 1977, - 1983, - 1988, - 1994, - 2005, - 2011, - 2016, - 2022, - 2033, - 2039, - 2044, - } + ne_years_have = {1977, 1983, 1988, 1994, 2005, 2011, 2016, 2022, 2033, 2039, 2044} self.assertHolidayName( name, self.prov_hols["NE"], (f"{year}-12-26" for year in ne_years_have) ) diff --git a/tests/countries/test_thailand.py b/tests/countries/test_thailand.py index 0f5066937..a51cbfa9d 100644 --- a/tests/countries/test_thailand.py +++ b/tests/countries/test_thailand.py @@ -116,10 +116,7 @@ def test_special_holidays(self): def test_2022_all(self): self.assertHolidays( - Thailand( - categories=(ARMED_FORCES, GOVERNMENT, PUBLIC, SCHOOL, WORKDAY), - years=2022, - ), + Thailand(categories=(ARMED_FORCES, GOVERNMENT, PUBLIC, SCHOOL, WORKDAY), years=2022), ("2022-01-01", "วันขึ้นปีใหม่"), ("2022-01-03", "ชดเชยวันขึ้นปีใหม่"), ("2022-01-08", "วันเด็กแห่งชาติ"), @@ -680,8 +677,7 @@ def test_raeknakhwan(self): def test_armed_forces_holiday(self): name = "วันกองทัพไทย" self.assertHolidays( - Thailand(categories=ARMED_FORCES, years=range(1958, 1960)), - ("1959-04-08", name), + Thailand(categories=ARMED_FORCES, years=range(1958, 1960)), ("1959-04-08", name) ) self.assertHolidays( Thailand(categories=ARMED_FORCES, years=range(1979, 1981)), diff --git a/tests/countries/test_timor_leste.py b/tests/countries/test_timor_leste.py index 8baa330bf..ad21196fb 100644 --- a/tests/countries/test_timor_leste.py +++ b/tests/countries/test_timor_leste.py @@ -522,10 +522,7 @@ def test_l10n_tet(self): ("2023-04-07", "Sesta-Feira Santa"), ("2023-04-22", "Idul-Fitri"), ("2023-05-01", "Loron Mundiál Serbisu-na'in sira nian"), - ( - "2023-05-18", - "Loron Ascensão do Senhor Jesus Cristo hi'it An ba Lalehan nian", - ), + ("2023-05-18", "Loron Ascensão do Senhor Jesus Cristo hi'it An ba Lalehan nian"), ("2023-05-20", "Loron Restaurasaun Independénsia nian"), ("2023-06-01", "Loron Mundial ba Labarik"), ("2023-06-08", "Festa Korpu de Deus"), diff --git a/tests/countries/test_tonga.py b/tests/countries/test_tonga.py index be9ba6a69..e64a6d0c9 100644 --- a/tests/countries/test_tonga.py +++ b/tests/countries/test_tonga.py @@ -138,15 +138,9 @@ def test_2017(self): ("2017-04-17", "Monite 'o e Toetu'u"), ("2017-04-25", "'Aho Anzac"), ("2017-06-05", "'Aho Tau'ataina (fakatokanga'i)"), - ( - "2017-07-04", - "'Aho 'Alo'i 'o 'Ene 'Afio ko e Tu'i 'o Tonga 'oku lolotonga Pule", - ), + ("2017-07-04", "'Aho 'Alo'i 'o 'Ene 'Afio ko e Tu'i 'o Tonga 'oku lolotonga Pule"), ("2017-09-17", "'Aho 'Alo'i 'o e 'Ea ki he Kalauni 'o Tonga"), - ( - "2017-09-18", - "'Aho 'Alo'i 'o e 'Ea ki he Kalauni 'o Tonga (fakatokanga'i)", - ), + ("2017-09-18", "'Aho 'Alo'i 'o e 'Ea ki he Kalauni 'o Tonga (fakatokanga'i)"), ("2017-11-06", "'Aho Konisitutone (fakatokanga'i)"), ("2017-11-29", "'Aho malolo 'akapulu 'a Tonga"), ( @@ -166,10 +160,7 @@ def test_2018(self): ("2018-04-02", "Monite 'o e Toetu'u"), ("2018-04-25", "'Aho Anzac"), ("2018-06-04", "'Aho Tau'ataina"), - ( - "2018-07-04", - "'Aho 'Alo'i 'o 'Ene 'Afio ko e Tu'i 'o Tonga 'oku lolotonga Pule", - ), + ("2018-07-04", "'Aho 'Alo'i 'o 'Ene 'Afio ko e Tu'i 'o Tonga 'oku lolotonga Pule"), ("2018-09-17", "'Aho 'Alo'i 'o e 'Ea ki he Kalauni 'o Tonga"), ("2018-11-05", "'Aho Konisitutone (fakatokanga'i)"), ( @@ -192,10 +183,7 @@ def test_2019(self): ("2019-04-22", "Monite 'o e Toetu'u"), ("2019-04-25", "'Aho Anzac"), ("2019-06-03", "'Aho Tau'ataina (fakatokanga'i)"), - ( - "2019-07-04", - "'Aho 'Alo'i 'o 'Ene 'Afio ko e Tu'i 'o Tonga 'oku lolotonga Pule", - ), + ("2019-07-04", "'Aho 'Alo'i 'o 'Ene 'Afio ko e Tu'i 'o Tonga 'oku lolotonga Pule"), ("2019-09-17", "'Aho 'Alo'i 'o e 'Ea ki he Kalauni 'o Tonga"), ("2019-09-19", "Me'afaka'eiki 'o e Siteiti 'Akilisi Pohiva"), ("2019-11-04", "'Aho Konisitutone"), @@ -220,10 +208,7 @@ def test_2020(self): ("2020-04-13", "Monite 'o e Toetu'u"), ("2020-04-25", "'Aho Anzac"), ("2020-06-08", "'Aho Tau'ataina (fakatokanga'i)"), - ( - "2020-07-04", - "'Aho 'Alo'i 'o 'Ene 'Afio ko e Tu'i 'o Tonga 'oku lolotonga Pule", - ), + ("2020-07-04", "'Aho 'Alo'i 'o 'Ene 'Afio ko e Tu'i 'o Tonga 'oku lolotonga Pule"), ("2020-09-17", "'Aho 'Alo'i 'o e 'Ea ki he Kalauni 'o Tonga"), ("2020-11-02", "'Aho Konisitutone (fakatokanga'i)"), ( @@ -246,10 +231,7 @@ def test_2021(self): ("2021-04-05", "Monite 'o e Toetu'u"), ("2021-04-25", "'Aho Anzac"), ("2021-06-07", "'Aho Tau'ataina (fakatokanga'i)"), - ( - "2021-07-04", - "'Aho 'Alo'i 'o 'Ene 'Afio ko e Tu'i 'o Tonga 'oku lolotonga Pule", - ), + ("2021-07-04", "'Aho 'Alo'i 'o 'Ene 'Afio ko e Tu'i 'o Tonga 'oku lolotonga Pule"), ( "2021-07-05", ( @@ -280,10 +262,7 @@ def test_2022(self): ("2022-04-18", "Monite 'o e Toetu'u"), ("2022-04-25", "'Aho Anzac"), ("2022-06-06", "'Aho Tau'ataina (fakatokanga'i)"), - ( - "2022-07-04", - "'Aho 'Alo'i 'o 'Ene 'Afio ko e Tu'i 'o Tonga 'oku lolotonga Pule", - ), + ("2022-07-04", "'Aho 'Alo'i 'o 'Ene 'Afio ko e Tu'i 'o Tonga 'oku lolotonga Pule"), ("2022-09-17", "'Aho 'Alo'i 'o e 'Ea ki he Kalauni 'o Tonga"), ("2022-11-07", "'Aho Konisitutone (fakatokanga'i)"), ( @@ -306,10 +285,7 @@ def test_2024(self): ("2024-04-01", "Monite 'o e Toetu'u"), ("2024-04-25", "'Aho Anzac"), ("2024-06-03", "'Aho Tau'ataina (fakatokanga'i)"), - ( - "2024-07-04", - "'Aho 'Alo'i 'o 'Ene 'Afio ko e Tu'i 'o Tonga 'oku lolotonga Pule", - ), + ("2024-07-04", "'Aho 'Alo'i 'o 'Ene 'Afio ko e Tu'i 'o Tonga 'oku lolotonga Pule"), ("2024-09-17", "'Aho 'Alo'i 'o e 'Ea ki he Kalauni 'o Tonga"), ("2024-11-04", "'Aho Konisitutone"), ( @@ -331,15 +307,9 @@ def test_l10n_default(self): ("2023-04-10", "Monite 'o e Toetu'u"), ("2023-04-25", "'Aho Anzac"), ("2023-06-05", "'Aho Tau'ataina (fakatokanga'i)"), - ( - "2023-07-04", - "'Aho 'Alo'i 'o 'Ene 'Afio ko e Tu'i 'o Tonga 'oku lolotonga Pule", - ), + ("2023-07-04", "'Aho 'Alo'i 'o 'Ene 'Afio ko e Tu'i 'o Tonga 'oku lolotonga Pule"), ("2023-09-17", "'Aho 'Alo'i 'o e 'Ea ki he Kalauni 'o Tonga"), - ( - "2023-09-18", - "'Aho 'Alo'i 'o e 'Ea ki he Kalauni 'o Tonga (fakatokanga'i)", - ), + ("2023-09-18", "'Aho 'Alo'i 'o e 'Ea ki he Kalauni 'o Tonga (fakatokanga'i)"), ("2023-11-06", "'Aho Konisitutone (fakatokanga'i)"), ( "2023-12-04", diff --git a/tests/countries/test_ukraine.py b/tests/countries/test_ukraine.py index 822553e27..5888bddbd 100644 --- a/tests/countries/test_ukraine.py +++ b/tests/countries/test_ukraine.py @@ -421,10 +421,7 @@ def test_2021(self): ("2021-05-02", "Великдень (Пасха)"), ("2021-05-03", "День праці (вихідний)"), ("2021-05-04", "Великдень (Пасха) (вихідний)"), - ( - "2021-05-09", - "День перемоги над нацизмом у Другій світовій війні (День перемоги)", - ), + ("2021-05-09", "День перемоги над нацизмом у Другій світовій війні (День перемоги)"), ( "2021-05-10", "День перемоги над нацизмом у Другій світовій війні (День перемоги) (вихідний)", @@ -461,10 +458,7 @@ def test_l10n_default(self): ("2021-05-02", "Великдень (Пасха)"), ("2021-05-03", "День праці (вихідний)"), ("2021-05-04", "Великдень (Пасха) (вихідний)"), - ( - "2021-05-09", - "День перемоги над нацизмом у Другій світовій війні (День перемоги)", - ), + ("2021-05-09", "День перемоги над нацизмом у Другій світовій війні (День перемоги)"), ( "2021-05-10", "День перемоги над нацизмом у Другій світовій війні (День перемоги) (вихідний)", @@ -492,10 +486,7 @@ def test_l10n_en_us(self): ("2021-05-03", "Labor Day (observed)"), ("2021-05-04", "Easter Sunday (Pascha) (observed)"), ("2021-05-09", "Day of Victory over Nazism in World War II (Victory Day)"), - ( - "2021-05-10", - "Day of Victory over Nazism in World War II (Victory Day) (observed)", - ), + ("2021-05-10", "Day of Victory over Nazism in World War II (Victory Day) (observed)"), ("2021-06-20", "Holy Trinity Day"), ("2021-06-21", "Holy Trinity Day (observed)"), ("2021-06-28", "Day of the Constitution of Ukraine"), @@ -518,10 +509,7 @@ def test_l10n_ar(self): ("2021-05-02", "عيد الفصح"), ("2021-05-03", "(يوم عطلة) عيد العمال"), ("2021-05-04", "(يوم عطلة) عيد الفصح"), - ( - "2021-05-09", - "يوم النصر على النازية في الحرب العالمية الثانية (يوم النصر)", - ), + ("2021-05-09", "يوم النصر على النازية في الحرب العالمية الثانية (يوم النصر)"), ( "2021-05-10", "(يوم عطلة) يوم النصر على النازية في الحرب العالمية الثانية (يوم النصر)", diff --git a/tests/countries/test_united_kingdom.py b/tests/countries/test_united_kingdom.py index 690cb261c..2543f0f23 100644 --- a/tests/countries/test_united_kingdom.py +++ b/tests/countries/test_united_kingdom.py @@ -103,9 +103,7 @@ def test_new_year_scotland(self): ) self.assertHolidayName(f"{name_new_year} (observed)", holidays, ny_obs_dt) self.assertHolidayName( - name_new_year_holiday, - holidays, - (f"{year}-01-02" for year in range(1950, 2050)), + name_new_year_holiday, holidays, (f"{year}-01-02" for year in range(1950, 2050)) ) self.assertHolidayName(f"{name_new_year_holiday} (observed)", holidays, nyh_obs_dt) self.assertNoNonObservedHoliday( @@ -137,9 +135,7 @@ def test_st_patricks_day(self): ) for subdiv in ("NIR", "Northern Ireland"): self.assertHolidayName( - name, - self.subdiv_holidays[subdiv], - (f"{year}-03-17" for year in range(1950, 2050)), + name, self.subdiv_holidays[subdiv], (f"{year}-03-17" for year in range(1950, 2050)) ) self.assertHolidayName(f"{name} (observed)", self.subdiv_holidays[subdiv], obs_dt) self.assertNoNonObservedHoliday(UnitedKingdom(subdiv=subdiv, observed=False), obs_dt) @@ -147,8 +143,7 @@ def test_st_patricks_day(self): for subdiv in ("ENG", "SCT", "WLS", "England", "Scotland", "Wales"): self.assertNoHoliday( - self.subdiv_holidays[subdiv], - (f"{year}-03-17" for year in range(1950, 2050)), + self.subdiv_holidays[subdiv], (f"{year}-03-17" for year in range(1950, 2050)) ) self.assertNoHolidayName(name, self.subdiv_holidays[subdiv], range(1950, 2050)) self.assertNoHoliday(f"{year}-03-17" for year in range(1950, 2050)) @@ -239,17 +234,14 @@ def test_battle_of_the_boyne_day(self): ) for subdiv in ("NIR", "Northern Ireland"): self.assertHolidayName( - name, - self.subdiv_holidays[subdiv], - (f"{year}-07-12" for year in range(1950, 2050)), + name, self.subdiv_holidays[subdiv], (f"{year}-07-12" for year in range(1950, 2050)) ) self.assertHolidayName(f"{name} (observed)", self.subdiv_holidays[subdiv], obs_dt) self.assertNoNonObservedHoliday(UnitedKingdom(subdiv=subdiv, observed=False), obs_dt) for subdiv in ("ENG", "SCT", "WLS", "England", "Scotland", "Wales"): self.assertNoHoliday( - self.subdiv_holidays[subdiv], - (f"{year}-07-12" for year in range(1950, 2050)), + self.subdiv_holidays[subdiv], (f"{year}-07-12" for year in range(1950, 2050)) ) self.assertNoHolidayName(name, self.subdiv_holidays[subdiv], range(1950, 2050)) self.assertNoHoliday(f"{year}-07-12" for year in range(1950, 2050)) @@ -334,13 +326,10 @@ def test_st_andrews_day(self): ) for subdiv in ("SCT", "Scotland"): self.assertHolidayName( - name, - self.subdiv_holidays[subdiv], - (f"{year}-11-30" for year in range(2006, 2050)), + name, self.subdiv_holidays[subdiv], (f"{year}-11-30" for year in range(2006, 2050)) ) self.assertNoHoliday( - self.subdiv_holidays[subdiv], - (f"{year}-11-30" for year in range(1950, 2006)), + self.subdiv_holidays[subdiv], (f"{year}-11-30" for year in range(1950, 2006)) ) self.assertNoHolidayName(name, self.subdiv_holidays[subdiv], range(1950, 2006)) self.assertHolidayName(f"{name} (observed)", self.subdiv_holidays[subdiv], obs_dt) @@ -355,8 +344,7 @@ def test_st_andrews_day(self): "Wales", ): self.assertNoHoliday( - self.subdiv_holidays[subdiv], - (f"{year}-11-30" for year in range(1950, 2050)), + self.subdiv_holidays[subdiv], (f"{year}-11-30" for year in range(1950, 2050)) ) self.assertNoHolidayName(name, self.subdiv_holidays[subdiv], range(1950, 2050)) self.assertNoHoliday(f"{year}-11-30" for year in range(1950, 2050)) @@ -404,9 +392,7 @@ def test_boxing_day(self): def test_boxing_day_scotland(self): name = "Boxing Day" self.assertHolidayName( - name, - self.subdiv_holidays["SCT"], - (f"{year}-12-26" for year in range(1974, 2050)), + name, self.subdiv_holidays["SCT"], (f"{year}-12-26" for year in range(1974, 2050)) ) self.assertNoHolidayName(name, self.subdiv_holidays["SCT"], range(1950, 1974)) diff --git a/tests/countries/test_united_states.py b/tests/countries/test_united_states.py index 949adf363..6d2b637a1 100644 --- a/tests/countries/test_united_states.py +++ b/tests/countries/test_united_states.py @@ -218,15 +218,7 @@ def test_martin_luther_king_day(self): ) self.assertHolidayName(name, dt) - for subdiv in set(UnitedStates.subdivisions) - { - "AL", - "AR", - "AZ", - "GA", - "ID", - "MS", - "NH", - }: + for subdiv in set(UnitedStates.subdivisions) - {"AL", "AR", "AZ", "GA", "ID", "MS", "NH"}: self.assertHolidayName(name, self.state_hols[subdiv], dt) self.assertNoHolidayName(name, self.state_hols[subdiv], range(1865, 1986)) @@ -250,9 +242,7 @@ def test_martin_luther_king_day_states(self): ) self.assertHolidayName( - "Martin Luther King, Jr & Robert E. Lee's Birthday", - self.state_hols["AL"], - dt, + "Martin Luther King, Jr & Robert E. Lee's Birthday", self.state_hols["AL"], dt ) self.assertHolidayName( @@ -336,9 +326,7 @@ def test_martin_luther_king_day_states(self): ) self.assertHolidayName( - "Dr. Martin Luther King Jr. and Robert E. Lee's Birthdays", - self.state_hols["MS"], - dt, + "Dr. Martin Luther King Jr. and Robert E. Lee's Birthdays", self.state_hols["MS"], dt ) self.assertHolidayName( @@ -395,9 +383,7 @@ def test_washingtons_birthday_states(self): ) self.assertHolidayName( - "George Washington's Birthday and Daisy Gatson Bates Day", - self.state_hols["AR"], - dt, + "George Washington's Birthday and Daisy Gatson Bates Day", self.state_hols["AR"], dt ) self.assertNoHoliday(self.state_hols["DE"], dt) @@ -704,9 +690,7 @@ def test_inauguration_day(self): self.assertNoHolidayName(name, self.state_hols[subdiv], years_no) self.assertHolidayName(f"{name} (observed)", self.state_hols[subdiv], obs_dt) self.assertNoNonObservedHolidayName( - f"{name} (observed)", - UnitedStates(subdiv=subdiv, observed=False), - obs_dt, + f"{name} (observed)", UnitedStates(subdiv=subdiv, observed=False), obs_dt ) def test_lincolns_birthday(self): @@ -721,15 +705,11 @@ def test_lincolns_birthday(self): ) for subdiv in ("CT", "IA", "IL", "NJ", "NY"): self.assertHolidayName( - name, - self.state_hols[subdiv], - (f"{year}-02-12" for year in range(1971, 2050)), + name, self.state_hols[subdiv], (f"{year}-02-12" for year in range(1971, 2050)) ) self.assertHolidayName(f"{name} (observed)", self.state_hols[subdiv], obs_dt) self.assertNoNonObservedHolidayName( - f"{name} (observed)", - UnitedStates(subdiv=subdiv, observed=False), - obs_dt, + f"{name} (observed)", UnitedStates(subdiv=subdiv, observed=False), obs_dt ) obs_dt = ( "1994-02-11", @@ -1032,9 +1012,7 @@ def test_patriots_day(self): ) for subdiv in ("MA", "ME"): self.assertHolidayName( - name, - self.state_hols[subdiv], - (f"{year}-04-19" for year in range(1894, 1969)), + name, self.state_hols[subdiv], (f"{year}-04-19" for year in range(1894, 1969)) ) self.assertNoHolidayName(name, self.state_hols[subdiv], range(1865, 1894)) self.assertHolidayName(name, self.state_hols[subdiv], dt) @@ -1646,9 +1624,7 @@ def test_after_thanksgiving_day(self): self.assertNoHolidayName(name) self.assertHolidayName(name, self.state_hols[subdiv], dt) self.assertHolidayName( - name, - self.state_hols[subdiv], - range(start_year if start_year > 0 else 1865, 2050), + name, self.state_hols[subdiv], range(start_year if start_year > 0 else 1865, 2050) ) if start_year > 0: self.assertNoHolidayName(name, self.state_hols[subdiv], range(1865, start_year)) @@ -1738,9 +1714,7 @@ def test_christmas_eve(self): self.assertNoHolidayName(name, self.state_hols[subdiv], range(1865, start_year)) self.assertHolidayName(f"{name} (observed)", self.state_hols[subdiv], obs_dt) self.assertNoNonObservedHolidayName( - f"{name} (observed)", - UnitedStates(subdiv=subdiv, observed=False), - obs_dt, + f"{name} (observed)", UnitedStates(subdiv=subdiv, observed=False), obs_dt ) def test_day_after_christmas(self): @@ -1791,7 +1765,5 @@ def test_new_years_eve(self): self.assertNoHolidayName(name, self.state_hols[subdiv], range(1865, start_year)) self.assertHolidayName(f"{name} (observed)", self.state_hols[subdiv], obs_dt) self.assertNoNonObservedHolidayName( - f"{name} (observed)", - UnitedStates(subdiv=subdiv, observed=False), - obs_dt, + f"{name} (observed)", UnitedStates(subdiv=subdiv, observed=False), obs_dt ) diff --git a/tests/countries/test_uruguay.py b/tests/countries/test_uruguay.py index a3c833732..101ba44bb 100644 --- a/tests/countries/test_uruguay.py +++ b/tests/countries/test_uruguay.py @@ -52,8 +52,7 @@ def test_cry_of_asencio(self): def test_labor_day(self): name = "Día de los Trabajadores" self.assertHolidayName( - name, - (f"{year}-05-01" for year in set(range(1920, 2050)).difference({1980, 1981})), + name, (f"{year}-05-01" for year in set(range(1920, 2050)).difference({1980, 1981})) ) self.assertHolidayName( name, @@ -88,8 +87,7 @@ def test_constitution_day(self): def test_independence_day(self): self.assertHolidayName( - "Declaratoria de la Independencia", - (f"{year}-08-25" for year in range(1920, 2050)), + "Declaratoria de la Independencia", (f"{year}-08-25" for year in range(1920, 2050)) ) def test_italy_day(self): @@ -115,9 +113,7 @@ def test_christmas(self): def test_childrens_day(self): self.assertHolidayName( - "Día de los Niños", - self.bank_holidays, - (f"{year}-01-06" for year in range(1920, 2050)), + "Día de los Niños", self.bank_holidays, (f"{year}-01-06" for year in range(1920, 2050)) ) def test_carnival(self): diff --git a/tests/countries/test_vatican_city.py b/tests/countries/test_vatican_city.py index 87fe10d5a..16e483c24 100644 --- a/tests/countries/test_vatican_city.py +++ b/tests/countries/test_vatican_city.py @@ -117,8 +117,7 @@ def test_saint_joseph_workers_day(self): def test_saints_peter_and_paul_day(self): self.assertHolidayName( - "Saint Peter and Saint Paul's Day", - (f"{year}-06-29" for year in range(1970, 2050)), + "Saint Peter and Saint Paul's Day", (f"{year}-06-29" for year in range(1970, 2050)) ) def test_assumption_day(self): diff --git a/tests/countries/test_vietnam.py b/tests/countries/test_vietnam.py index def510349..92fe03161 100644 --- a/tests/countries/test_vietnam.py +++ b/tests/countries/test_vietnam.py @@ -33,8 +33,7 @@ def test_common(self): def test_first_day_of_january(self): self.assertHolidayName( - "International New Year's Day", - (f"{year}-01-01" for year in range(1979, 2050)), + "International New Year's Day", (f"{year}-01-01" for year in range(1979, 2050)) ) def test_lunar_new_year(self): @@ -73,8 +72,7 @@ def test_king_hung_day(self): def test_liberation_day(self): self.assertHolidayName( - "Liberation Day/Reunification Day", - (f"{year}-04-30" for year in range(1979, 2050)), + "Liberation Day/Reunification Day", (f"{year}-04-30" for year in range(1979, 2050)) ) def test_international_labor_day(self): diff --git a/tests/test_holiday_base.py b/tests/test_holiday_base.py index 2f0650fda..7e5df8def 100644 --- a/tests/test_holiday_base.py +++ b/tests/test_holiday_base.py @@ -163,8 +163,7 @@ def test_years(self): self.assertSetEqual(hb.years, {2013, 2014, 2015}) self.assertSetEqual( - HolidayBase(years=range(2010, 2016)).years, - {2010, 2011, 2012, 2013, 2014, 2015}, + HolidayBase(years=range(2010, 2016)).years, {2010, 2011, 2012, 2013, 2014, 2015} ) self.assertSetEqual(HolidayBase(years=(2013, 2015, 2015)).years, {2013, 2015}) self.assertSetEqual(HolidayBase(years=2015).years, {2015}) @@ -200,12 +199,7 @@ def test_default_category(self): self.assertEqual(ccc.categories, {TestCategories.CustomCategoryClass.default_category}) for name in ("CC Holiday",): self.assertTrue(ccc.get_named(name, lookup="exact")) - for name in ( - "CC1 Holiday", - "CC2 Holiday", - "SD_1 CC_1 Holiday", - "SD_2 CC Holiday", - ): + for name in ("CC1 Holiday", "CC2 Holiday", "SD_1 CC_1 Holiday", "SD_2 CC Holiday"): self.assertFalse(ccc.get_named(name, lookup="exact")) # Default category with subdiv. @@ -220,8 +214,7 @@ def test_no_default_category(self): TestCategories.CustomCategoryClass.default_category = None self.assertRaises(ValueError, lambda: TestCategories.CustomCategoryClass(years=2024)) self.assertRaises( - ValueError, - lambda: TestCategories.CustomCategoryClass(years=2024, subdiv="SD_1"), + ValueError, lambda: TestCategories.CustomCategoryClass(years=2024, subdiv="SD_1") ) # Explicitly set category. @@ -355,8 +348,7 @@ def test_get_list_multiple_subdivisions(self): hb_combined = hb_subdiv_1 + hb_subdiv_2 self.assertEqual( - hb_combined["2021-08-10"], - "Subdiv 1 Custom Holiday; Subdiv 2 Custom Holiday", + hb_combined["2021-08-10"], "Subdiv 1 Custom Holiday; Subdiv 2 Custom Holiday" ) self.assertListEqual( hb_combined.get_list("2021-08-10"), @@ -442,12 +434,7 @@ def test_istartswith(self): hb = CountryStub1(years=2022) for name in ("new year's", "New Year's", "New Year's day"): self.assertListEqual(hb.get_named(name, lookup="istartswith"), [date(2022, 1, 1)]) - for name in ( - "New Year Day", - "New Year holiday", - "New Year's Day Holiday", - "year", - ): + for name in ("New Year Day", "New Year holiday", "New Year's Day Holiday", "year"): self.assertListEqual(hb.get_named(name, lookup="istartswith"), []) self.assertListEqual( hb.get_named("independence day", lookup="istartswith"), [date(2022, 7, 4)] @@ -464,12 +451,7 @@ def test_startswith(self): hb = CountryStub1(years=2022) for name in ("New Year's", "New Year"): self.assertListEqual(hb.get_named(name, lookup="startswith"), [date(2022, 1, 1)]) - for name in ( - "New Year Day", - "New Year Holiday", - "New Year's Day Holiday", - "year", - ): + for name in ("New Year Day", "New Year Holiday", "New Year's Day Holiday", "year"): self.assertListEqual(hb.get_named(name, lookup="startswith"), []) self.assertListEqual( hb.get_named("Independence Day", lookup="startswith"), [date(2022, 7, 4)] @@ -594,8 +576,7 @@ def test_add_country(self): self.hb_combined = CountryStub1(years=2014, subdiv="Subdiv 1") self.hb_combined += CountryStub1(years=2014, subdiv="Subdiv 2") self.assertEqual( - self.hb_combined["2014-08-10"], - "Subdiv 1 Custom Holiday; Subdiv 2 Custom Holiday", + self.hb_combined["2014-08-10"], "Subdiv 1 Custom Holiday; Subdiv 2 Custom Holiday" ) self.assertRaises(TypeError, lambda: self.hb_1 + {})