Skip to content

Commit

Permalink
Merge pull request #945 from arkid15r/fix-test-warnings
Browse files Browse the repository at this point in the history
Suppress warnings for tests
  • Loading branch information
arkid15r authored Feb 15, 2023
2 parents f6e47d1 + fa0d170 commit f2571fa
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion holidays/countries/marshall_islands.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def _populate(self, year):
warnings.warn(
"Years before 2022 are not available for the Marshall Islands "
"(MH).",
DeprecationWarning,
Warning,
)

# New Year's Day
Expand Down
2 changes: 2 additions & 0 deletions tests/countries/test_marshall_islands.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
# License: MIT (see LICENSE file)

import unittest
import warnings
from datetime import date

import holidays
Expand All @@ -19,6 +20,7 @@
class TestMH(unittest.TestCase):
def setUp(self):
self.holidays = holidays.MH()
warnings.simplefilter("ignore")

def test_2022(self):
# https://www.register-iri.com/info-center/the-marshall-islands/
Expand Down
2 changes: 2 additions & 0 deletions tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
# License: MIT (see LICENSE file)

import unittest
import warnings
from datetime import date

from holidays import utils
Expand Down Expand Up @@ -93,6 +94,7 @@ def test_all_countries(self):
This is logic test and not a code compatibility test, so for expediency
we only run it once on the latest Python version.
"""
warnings.simplefilter("ignore")
for country in utils.list_supported_countries():
for year in range(date.today().year - 10, date.today().year + 3):
for holiday in utils.country_holidays(country, years=year):
Expand Down

0 comments on commit f2571fa

Please sign in to comment.