Repository: vacanza/holidays
Pull request #2235 (2025-01-21 20:46:39)

Update Slovakia holidays: Constitution Day is working day since 2024
<!--
  Thanks for contributing to holidays!
-->

## Proposed change

<!--
  Describe the big picture of your changes.
  Don't forget to link your PR to an existing issue if any.
-->

Update Slovakia holidays: Constitution Day is working day since 2024.

## Type of change

<!--
  Type of change you want to introduce. Please, check one (1) box only!
  If your PR requires multiple boxes to be checked, most likely it needs to
  be split into multiple PRs.
-->

- [ ] New country/market holidays support (thank you!)
- [x] Supported country/market holidays update (calendar discrepancy fix, localization)
- [ ] Existing code/documentation/test/process quality improvement (best practice, cleanup, refactoring, optimization)
- [ ] Dependency update (version deprecation/pin/upgrade)
- [ ] Bugfix (non-breaking change which fixes an issue)
- [ ] Breaking change (a code change causing existing functionality to break)
- [ ] New feature (new `holidays` functionality in general)

## Checklist

<!--
  Put an `x` in the boxes that apply. You can change them after PR is created.
-->

- [x] I've followed the [contributing guidelines][contributing-guidelines]
- [x] I've successfully run `make check`, all checks and tests are green

<!--
  Thanks again for your contribution!
-->

[contributing-guidelines]: https://github.com/vacanza/holidays/blob/dev/CONTRIBUTING.rst
[docs]: https://github.com/vacanza/holidays/tree/dev/docs/source


sonarqubecloud[bot]: ## [![Quality Gate Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png 'Quality Gate Passed')](https://sonarcloud.io/dashboard?id=vacanza_python-holidays&pullRequest=2235) **Quality Gate passed**  
Issues  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 New issues](https://sonarcloud.io/project/issues?id=vacanza_python-holidays&pullRequest=2235&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png '') [0 Accepted issues](https://sonarcloud.io/project/issues?id=vacanza_python-holidays&pullRequest=2235&issueStatuses=ACCEPTED)

Measures  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=vacanza_python-holidays&pullRequest=2235&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=vacanza_python-holidays&pullRequest=2235&metric=new_coverage&view=list)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=vacanza_python-holidays&pullRequest=2235&metric=new_duplicated_lines_density&view=list)  
  
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=vacanza_python-holidays&pullRequest=2235)


codecov[bot]: ## [Codecov](https://app.codecov.io/gh/vacanza/holidays/pull/2235?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=vacanza) Report
All modified and coverable lines are covered by tests :white_check_mark:
> Project coverage is 100.00%. Comparing base [(`582944e`)](https://app.codecov.io/gh/vacanza/holidays/commit/582944e2ff5594c4ab73a63ca00dc07f8406b092?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=vacanza) to head [(`3449f5b`)](https://app.codecov.io/gh/vacanza/holidays/commit/3449f5b93ee53199af79816609036845a51de893?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=vacanza).

<details><summary>Additional details and impacted files</summary>


```diff
@@            Coverage Diff            @@
##               dev     #2235   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          196       196           
  Lines        11849     11854    +5     
  Branches      1710      1713    +3     
=========================================
+ Hits         11849     11854    +5     
```

</details>

[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/vacanza/holidays/pull/2235?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=vacanza).   
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=vacanza).

sonarqubecloud[bot]: ## [![Quality Gate Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png 'Quality Gate Passed')](https://sonarcloud.io/dashboard?id=vacanza_python-holidays&pullRequest=2235) **Quality Gate passed**  
Issues  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 New issues](https://sonarcloud.io/project/issues?id=vacanza_python-holidays&pullRequest=2235&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png '') [0 Accepted issues](https://sonarcloud.io/project/issues?id=vacanza_python-holidays&pullRequest=2235&issueStatuses=ACCEPTED)

Measures  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=vacanza_python-holidays&pullRequest=2235&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=vacanza_python-holidays&pullRequest=2235&metric=new_coverage&view=list)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=vacanza_python-holidays&pullRequest=2235&metric=new_duplicated_lines_density&view=list)  
  
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=vacanza_python-holidays&pullRequest=2235)


sonarqubecloud[bot]: ## [![Quality Gate Passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/qg-passed-20px.png 'Quality Gate Passed')](https://sonarcloud.io/dashboard?id=vacanza_python-holidays&pullRequest=2235) **Quality Gate passed**  
Issues  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 New issues](https://sonarcloud.io/project/issues?id=vacanza_python-holidays&pullRequest=2235&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/accepted-16px.png '') [0 Accepted issues](https://sonarcloud.io/project/issues?id=vacanza_python-holidays&pullRequest=2235&issueStatuses=ACCEPTED)

Measures  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=vacanza_python-holidays&pullRequest=2235&issueStatuses=OPEN,CONFIRMED&sinceLeakPeriod=true)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Coverage on New Code](https://sonarcloud.io/component_measures?id=vacanza_python-holidays&pullRequest=2235&metric=new_coverage&view=list)  
![](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/passed-16px.png '') [0.0% Duplication on New Code](https://sonarcloud.io/component_measures?id=vacanza_python-holidays&pullRequest=2235&metric=new_duplicated_lines_density&view=list)  
  
[See analysis details on SonarQube Cloud](https://sonarcloud.io/dashboard?id=vacanza_python-holidays&pullRequest=2235)



Patch:
diff --git a/holidays/countries/slovakia.py b/holidays/countries/slovakia.py
index 5ba3152d..366e09ed 100644
--- a/holidays/countries/slovakia.py
+++ b/holidays/countries/slovakia.py
@@ -20,16 +20,17 @@ from holidays.holiday_base import HolidayBase
 
 class Slovakia(HolidayBase, ChristianHolidays, InternationalHolidays, StaticHolidays):
     """
-    https://en.wikipedia.org/wiki/Public_holidays_in_Slovakia
-    https://sk.wikipedia.org/wiki/Zoznam_sviatkov_na_Slovensku
-    https://www.slov-lex.sk/pravne-predpisy/SK/ZZ/1993/241/
+    References:
+        - https://en.wikipedia.org/wiki/Public_holidays_in_Slovakia
+        - https://sk.wikipedia.org/wiki/Zoznam_sviatkov_na_Slovensku
+        - https://www.slov-lex.sk/pravne-predpisy/SK/ZZ/1993/241/
     """
 
     country = "SK"
     default_language = "sk"
     supported_categories = (PUBLIC, WORKDAY)
     supported_languages = ("en_US", "sk", "uk")
-    # Independent Slovak Republic established on Jan 01, 1993
+    # Independent Slovak Republic established on Jan 01, 1993.
     start_year = 1993
 
     def __init__(self, *args, **kwargs):
@@ -66,8 +67,9 @@ class Slovakia(HolidayBase, ChristianHolidays, InternationalHolidays, StaticHoli
         # Slovak National Uprising Anniversary.
         self._add_holiday_aug_29(tr("Výročie Slovenského národného povstania"))
 
-        # Constitution Day.
-        self._add_holiday_sep_1(tr("Deň Ústavy Slovenskej republiky"))
+        if self._year <= 2023:
+            # Constitution Day.
+            self._add_holiday_sep_1(tr("Deň Ústavy Slovenskej republiky"))
 
         # Day of Our Lady of the Seven Sorrows.
         self._add_holiday_sep_15(tr("Sedembolestná Panna Mária"))
@@ -89,7 +91,12 @@ class Slovakia(HolidayBase, ChristianHolidays, InternationalHolidays, StaticHoli
         self._add_christmas_day_two(tr("Druhý sviatok vianočný"))
 
     def _populate_workday_holidays(self):
-        # According to Law 241/1993, this state holiday is not a non-working day.
+        # According to Law 241/1993, these state holidays are not non-working days.
+
+        if self._year >= 2024:
+            # Constitution Day.
+            self._add_holiday_sep_1(tr("Deň Ústavy Slovenskej republiky"))
+
         if self._year >= 2021:
             # Day of the Establishment of the Independent Czech-Slovak State.
             self._add_holiday_oct_28(tr("Deň vzniku samostatného česko-slovenského štátu"))


Test patch:
diff --git a/tests/countries/test_slovakia.py b/tests/countries/test_slovakia.py
index d2a5e810..5a1e6ce1 100644
--- a/tests/countries/test_slovakia.py
+++ b/tests/countries/test_slovakia.py
@@ -20,13 +20,16 @@ from tests.common import CommonCountryTests
 class TestSlovakia(CommonCountryTests, TestCase):
     @classmethod
     def setUpClass(cls):
-        super().setUpClass(Slovakia, years=range(1993, 2050))
+        years = range(1993, 2050)
+        super().setUpClass(Slovakia, years=years)
+        cls.workday_holidays = Slovakia(categories=WORKDAY, years=years)
 
     def test_country_aliases(self):
         self.assertAliases(Slovakia, SK, SVK)
 
     def test_no_holidays(self):
         self.assertNoHolidays(Slovakia(years=1992))
+        self.assertNoHolidays(Slovakia(categories=WORKDAY, years=2020))
 
     def test_special_holidays(self):
         self.assertHoliday(
@@ -45,24 +48,30 @@ class TestSlovakia(CommonCountryTests, TestCase):
         )
 
     def test_good_friday(self):
+        name = "Veľký piatok"
         self.assertHolidayName(
-            "Veľký piatok",
+            name,
             "2019-04-19",
             "2020-04-10",
             "2021-04-02",
             "2022-04-15",
             "2023-04-07",
+            "2024-03-29",
         )
+        self.assertHolidayName(name, range(1993, 2050))
 
     def test_easter_monday(self):
+        name = "Veľkonočný pondelok"
         self.assertHolidayName(
-            "Veľkonočný pondelok",
+            name,
             "2019-04-22",
             "2020-04-13",
             "2021-04-05",
             "2022-04-18",
             "2023-04-10",
+            "2024-04-01",
         )
+        self.assertHolidayName(name, range(1993, 2050))
 
     def test_labor_day(self):
         self.assertHolidayName("Sviatok práce", (f"{year}-05-01" for year in range(1993, 2050)))
@@ -86,15 +95,29 @@ class TestSlovakia(CommonCountryTests, TestCase):
         )
 
     def test_constitution_day(self):
+        name = "Deň Ústavy Slovenskej republiky"
+        self.assertHolidayName(name, (f"{year}-09-01" for year in range(1993, 2024)))
+        self.assertNoHoliday(f"{year}-09-01" for year in range(2024, 2050))
+        self.assertNoHolidayName(name, range(2024, 2050))
         self.assertHolidayName(
-            "Deň Ústavy Slovenskej republiky", (f"{year}-09-01" for year in range(1993, 2050))
+            name, self.workday_holidays, (f"{year}-09-01" for year in range(2024, 2050))
         )
+        self.assertNoHolidayName(name, self.workday_holidays, range(1993, 2024))
 
     def test_day_of_our_lady_of_the_seven_sorrows(self):
         self.assertHolidayName(
             "Sedembolestná Panna Mária", (f"{year}-09-15" for year in range(1993, 2050))
         )
 
+    def test_establishment_state_day(self):
+        name = "Deň vzniku samostatného česko-slovenského štátu"
+        self.assertNoHoliday(f"{year}-10-28" for year in range(1993, 2050))
+        self.assertNoHolidayName(name)
+        self.assertHolidayName(
+            name, self.workday_holidays, (f"{year}-10-28" for year in range(2021, 2050))
+        )
+        self.assertNoHolidayName(name, self.workday_holidays, range(1993, 2021))
+
     def test_all_saints_day(self):
         self.assertHolidayName(
             "Sviatok Všetkých svätých", (f"{year}-11-01" for year in range(1993, 2050))
@@ -119,13 +142,6 @@ class TestSlovakia(CommonCountryTests, TestCase):
             "Druhý sviatok vianočný", (f"{year}-12-26" for year in range(1993, 2050))
         )
 
-    def test_establishment_state_day(self):
-        name = "Deň vzniku samostatného česko-slovenského štátu"
-        holidays = Slovakia(categories=WORKDAY, years=range(1993, 2050))
-        self.assertHolidayName(name, holidays, (f"{year}-10-28" for year in range(2021, 2050)))
-        self.assertNoHoliday(holidays, (f"{year}-10-28" for year in range(1993, 2021)))
-        self.assertNoHolidayName(name, holidays, range(1993, 2021))
-
     def test_2021(self):
         self.assertHolidays(
             Slovakia(years=2021),
@@ -155,6 +171,13 @@ class TestSlovakia(CommonCountryTests, TestCase):
             ("2021-10-28", "Deň vzniku samostatného česko-slovenského štátu"),
         )
 
+    def test_workday_2024(self):
+        self.assertHolidays(
+            Slovakia(categories=WORKDAY, years=2024),
+            ("2024-09-01", "Deň Ústavy Slovenskej republiky"),
+            ("2024-10-28", "Deň vzniku samostatného česko-slovenského štátu"),
+        )
+
     def test_l10n_default(self):
         self.assertLocalizedHolidays(
             ("2022-01-01", "Deň vzniku Slovenskej republiky"),