Repository: dr-prodigy/python-holidays

Issue:
Add Juneteenth
https://www.nytimes.com/2021/06/17/us/politics/juneteenth-holiday-biden.html

Comments:

Patch:
diff --git a/CHANGES b/CHANGES
index 4d38f383..3f990929 100644
--- a/CHANGES
+++ b/CHANGES
@@ -3,6 +3,7 @@ Version 0.11.2
 
 Released ????, ????
 
+- Support for Venezuela #470 (antusystem, dr-p)
 - Poland fix #464 (m-ganko)
 - Singapore updates for 2022 #456 (mborsetti)
 - .gitignore fix #462 (TheLastProject)
diff --git a/README.rst b/README.rst
index 4e8df697..cb44ba7c 100644
--- a/README.rst
+++ b/README.rst
@@ -191,6 +191,7 @@ UnitedStates        US/USA    state = AL, AK, AS, AZ, AR, CA, CO, CT, DE, DC, FL
                               FM, MN, MS, MO, MT, NE, NV, NH, NJ, NM, NY, NC, ND, MP,
                               OH, OK, OR, PW, PA, PR, RI, SC, SD, TN, TX, UT, VT, VA,
                               VI, WA, WV, WI, WY
+Venezuela           YV/VEN
 Vietnam             VN/VNM
 Wales                         None
 =================== ========= =============================================================
diff --git a/holidays/countries/__init__.py b/holidays/countries/__init__.py
index 7bb1c290..3584e388 100644
--- a/holidays/countries/__init__.py
+++ b/holidays/countries/__init__.py
@@ -92,4 +92,5 @@ from .united_kingdom import (
     GBR,
 )
 from .united_states import UnitedStates, US, USA
+from .venezuela import Venezuela, YV, VEN
 from .vietnam import Vietnam, VN, VNM
diff --git a/holidays/countries/spain.py b/holidays/countries/spain.py
index 794032b1..6b2c8dd0 100644
--- a/holidays/countries/spain.py
+++ b/holidays/countries/spain.py
@@ -117,7 +117,7 @@ class Spain(HolidayBase):
             self._is_observed(date(year, MAR, 19), "San José")
         if self.prov and self.prov not in ["CT", "VC"]:
             self[easter(year) + rd(weeks=-1, weekday=TH)] = "Jueves Santo"
-            self[easter(year) + rd(weeks=-1, weekday=FR)] = "Viernes Santo"
+        self[easter(year) + rd(weeks=-1, weekday=FR)] = "Viernes Santo"
         if self.prov and self.prov in ["CT", "PV", "NC", "VC", "IB", "CM"]:
             self[easter(year) + rd(weekday=MO)] = "Lunes de Pascua"
         self._is_observed(date(year, MAY, 1), "Día del Trabajador")
diff --git a/holidays/countries/united_states.py b/holidays/countries/united_states.py
index fa3a23da..4be7f73c 100644
--- a/holidays/countries/united_states.py
+++ b/holidays/countries/united_states.py
@@ -375,6 +375,10 @@ class UnitedStates(HolidayBase):
                 elif date(year, JUN, 11).weekday() == SUN:
                     self[date(year, JUN, 12)] = "Kamehameha Day (Observed)"
 
+        # Juneteenth National Independence Day
+        if year >= 2021:
+            self[date(year, JUN, 19)] = "Juneteenth National Independence Day"
+
         # Emancipation Day In Texas
         if self.state == "TX" and year >= 1980:
             self[date(year, JUN, 19)] = "Emancipation Day In Texas"
diff --git a/holidays/countries/venezuela.py b/holidays/countries/venezuela.py
new file mode 100644
index 00000000..020a0122
--- /dev/null
+++ b/holidays/countries/venezuela.py
@@ -0,0 +1,97 @@
+# -*- coding: utf-8 -*-
+
+#  python-holidays
+#  ---------------
+#  A fast, efficient Python library for generating country, province and state
+#  specific sets of holidays on the fly. It aims to make determining whether a
+#  specific date is a holiday as fast and flexible as possible.
+#
+#  Author:  ryanss <ryanssdev@icloud.com> (c) 2014-2017
+#           dr-prodigy <maurizio.montel@gmail.com> (c) 2017-2021
+#  Website: https://github.com/dr-prodigy/python-holidays
+#  License: MIT (see LICENSE file)
+
+from datetime import date
+
+from dateutil.easter import easter
+from dateutil.relativedelta import relativedelta as rd, TH, FR
+
+from holidays.constants import (
+    JAN,
+    MAR,
+    APR,
+    MAY,
+    JUN,
+    JUL,
+    AUG,
+    SEP,
+    OCT,
+    NOV,
+    DEC,
+)
+from holidays.holiday_base import HolidayBase
+
+
+class Venezuela(HolidayBase):
+    """
+    https://dias-festivos.eu/dias-festivos/venezuela/#
+    """
+
+    def __init__(self, **kwargs):
+        self.country = "YV"
+        HolidayBase.__init__(self, **kwargs)
+
+    def _populate(self, year):
+        # New Year's Day
+        self[date(year, JAN, 1)] = "Año Nuevo [New Year's Day]"
+
+        self[date(year, MAY, 1)] = "Dia Mundial del Trabajador"
+
+        self[date(year, JUN, 24)] = "Batalla de Carabobo"
+
+        self[date(year, JUL, 5)] = "Dia de la Independencia"
+
+        self[date(year, JUL, 24)] = "Natalicio de Simón Bolívar"
+
+        self[date(year, OCT, 12)] = "Día de la Resistencia Indígena"
+
+        # Christmas Day
+        self[date(year, DEC, 24)] = "Nochebuena"
+
+        self[date(year, DEC, 25)] = "Día de Navidad"
+
+        self[date(year, DEC, 31)] = "Fiesta de Fin de Año"
+
+        # Semana Santa y Carnaval
+
+        if date(year, APR, 19) == (easter(year) - rd(days=2)):
+            self[
+                easter(year) - rd(days=2)
+            ] = "Viernes Santo y Declaración de la Independencia"
+        else:
+            # self[easter(year) - rd(weekday=FR(-1))] = "Viernes Santo"
+            self[date(year, APR, 19)] = "Declaración de la Independencia"
+            self[easter(year) - rd(days=2)] = "Viernes Santo"
+
+        # self[easter(year) - rd(weekday=TH(-1))] = "Jueves Santo"
+
+        if date(year, APR, 19) == (easter(year) - rd(days=3)):
+            self[easter(year) - rd(days=3)] = (
+                "Jueves Santo y Declaración " "de la Independencia"
+            )
+        else:
+            # self[easter(year) - rd(weekday=FR(-1))] = "Viernes Santo"
+            self[date(year, APR, 19)] = "Declaración de la Independencia"
+            self[easter(year) - rd(days=3)] = "Jueves Santo"
+
+        self[easter(year) - rd(days=47)] = "Martes de Carnaval"
+
+        self[easter(year) - rd(days=48)] = "Lunes de Carnaval"
+
+
+class YV(Venezuela):
+    pass
+
+
+class VEN(Venezuela):
+    pass


Test patch:
diff --git a/test/countries/__init__.py b/test/countries/__init__.py
index d0d28686..321e65f1 100644
--- a/test/countries/__init__.py
+++ b/test/countries/__init__.py
@@ -82,4 +82,5 @@ from .test_ukraine import *
 from .test_united_arab_emirates import *
 from .test_united_kingdom import *
 from .test_united_states import *
+from .test_venezuela import *
 from .test_vietnam import *
diff --git a/test/countries/test_spain.py b/test/countries/test_spain.py
index 7e8baaa5..6108ad57 100644
--- a/test/countries/test_spain.py
+++ b/test/countries/test_spain.py
@@ -19,7 +19,7 @@ from datetime import date
 import holidays
 
 
-class TestES(unittest.TestCase):
+class TestSpain(unittest.TestCase):
     def setUp(self):
         self.holidays = holidays.ES(observed=False)
         self.holidays_observed = holidays.ES()
@@ -63,9 +63,7 @@ class TestES(unittest.TestCase):
             self.assertEqual(
                 date(2016, 3, 24) in prov_holidays, prov not in ["CT", "VC"]
             )
-            self.assertEqual(
-                date(2016, 3, 25) in prov_holidays, prov not in ["CT", "VC"]
-            )
+            assert date(2016, 3, 25) in prov_holidays
             self.assertEqual(
                 date(2016, 3, 28) in prov_holidays,
                 prov in ["CT", "PV", "NC", "VC", "IB", "CM"],
diff --git a/test/countries/test_united_states.py b/test/countries/test_united_states.py
index 4fb4fbf2..1e1a344f 100644
--- a/test/countries/test_united_states.py
+++ b/test/countries/test_united_states.py
@@ -667,9 +667,15 @@ class TestUS(unittest.TestCase):
     def test_emancipation_day_in_texas(self):
         tx_holidays = holidays.US(state="TX")
         self.assertNotIn(date(1979, 6, 19), tx_holidays)
-        for year in (1980, 2050):
+        for year in (1980, 2020):
             self.assertNotIn(date(year, 6, 19), self.holidays)
             self.assertIn(date(year, 6, 19), tx_holidays)
+        for year in (2021, 2050):
+            self.assertIn(date(year, 6, 19), tx_holidays)
+
+    def test_juneteenth(self):
+        self.assertNotIn(date(2020, 6, 19), self.holidays)
+        self.assertIn(date(2021, 6, 19), self.holidays)
 
     def test_west_virginia_day(self):
         wv_holidays = holidays.US(state="WV")
diff --git a/test/countries/test_venezuela.py b/test/countries/test_venezuela.py
new file mode 100644
index 00000000..c7ab4631
--- /dev/null
+++ b/test/countries/test_venezuela.py
@@ -0,0 +1,68 @@
+# -*- coding: utf-8 -*-
+#  python-holidays
+#  ---------------
+#  A fast, efficient Python library for generating country, province and state
+#  specific sets of holidays on the fly. It aims to make determining whether a
+#  specific date is a holiday as fast and flexible as possible.
+#
+#  Author:  ryanss <ryanssdev@icloud.com> (c) 2014-2017
+#           dr-prodigy <maurizio.montel@gmail.com> (c) 2017-2021
+#  Website: https://github.com/dr-prodigy/python-holidays
+#  License: MIT (see LICENSE file)
+
+import unittest
+
+from datetime import date
+
+import holidays
+
+
+class TestVenezuela(unittest.TestCase):
+    def test_YV_holidays(self):
+        self.holidays = holidays.YV(years=2019)
+        self.assertIn("2019-01-01", self.holidays)
+        self.assertEqual(
+            self.holidays[date(2019, 1, 1)], "Año Nuevo [New Year's Day]"
+        )
+        self.assertIn("2019-03-04", self.holidays)
+        self.assertEqual(
+            self.holidays[date(2019, 3, 4)],
+            "Lunes de Carnaval",
+        )
+        self.assertIn("2019-03-05", self.holidays)
+        self.assertEqual(self.holidays[date(2019, 3, 5)], "Martes de Carnaval")
+        self.assertIn("2019-04-18", self.holidays)
+        self.assertEqual(self.holidays[date(2019, 4, 18)], "Jueves Santo")
+        self.assertIn("2019-04-19", self.holidays)
+        self.assertEqual(
+            self.holidays[date(2019, 4, 19)],
+            "Viernes Santo y Declaración de la Independencia",
+        )
+        self.assertIn("2019-05-01", self.holidays)
+        self.assertEqual(
+            self.holidays[date(2019, 5, 1)], "Dia Mundial del Trabajador"
+        )
+        self.assertIn("2019-06-24", self.holidays)
+        self.assertEqual(
+            self.holidays[date(2019, 6, 24)], "Batalla de Carabobo"
+        )
+        self.assertIn("2019-05-01", self.holidays)
+        self.assertEqual(
+            self.holidays[date(2019, 7, 5)], "Dia de la Independencia"
+        )
+        self.assertIn("2019-07-24", self.holidays)
+        self.assertEqual(
+            self.holidays[date(2019, 7, 24)], "Natalicio de Simón Bolívar"
+        )
+        self.assertIn("2019-10-12", self.holidays)
+        self.assertEqual(
+            self.holidays[date(2019, 10, 12)], "Día de la Resistencia Indígena"
+        )
+        self.assertIn("2019-12-24", self.holidays)
+        self.assertEqual(self.holidays[date(2019, 12, 24)], "Nochebuena")
+        self.assertIn("2019-12-25", self.holidays)
+        self.assertEqual(self.holidays[date(2019, 12, 25)], "Día de Navidad")
+        self.assertIn("2019-12-31", self.holidays)
+        self.assertEqual(
+            self.holidays[date(2019, 12, 31)], "Fiesta de Fin de Año"
+        )