Skip to content

Conversation

@KJhellico
Copy link
Collaborator

Proposed change

Unify some imports.

Type of change

  • New country/market holidays support (thank you!)
  • 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

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 21, 2025

Summary by CodeRabbit

  • Refactor
    • Standardized country-specific imports across multiple regions to improve consistency. No user-facing behavior changes expected.
  • Tests
    • Updated tests to align with the new import structure.
    • Simplified checks for observed holidays in Sierra Leone to rely directly on dates.
  • Style
    • Minor formatting cleanup in test files.

Walkthrough

Updated Sierra Leone country module to import _CustomIslamicHolidays from holidays.calendars. Adjusted multiple country tests to import symbols from specific submodules. Sierra Leone tests also revised observed-holiday assertions to drop no_estimated_holidays filtering.

Changes

Cohort / File(s) Summary of changes
Sierra Leone module import
holidays/countries/sierra_leone.py
Changed import of _CustomIslamicHolidays from holidays.calendars.islamic to holidays.calendars; no other logic changes.
Sierra Leone tests adjustments
tests/countries/test_sierra_leone.py
Updated imports to holidays.countries.sierra_leone; modified observed-holiday assertions to check dates directly (removed no_estimated_holidays filter).
Country tests import path updates
tests/countries/test_gambia.py, tests/countries/test_guinea_bissau.py, tests/countries/test_guyana.py, tests/countries/test_ivory_coast.py, tests/countries/test_mali.py, tests/countries/test_mauritius.py, tests/countries/test_suriname.py
Switched imports from holidays.countries to specific submodules (e.g., holidays.countries.gambia, …); no test logic changes.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested labels

test

Suggested reviewers

  • arkid15r
  • PPsyrius

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.


📜 Recent review details

Configuration used: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 5203f05 and 03abf4c.

📒 Files selected for processing (9)
  • holidays/countries/sierra_leone.py (1 hunks)
  • tests/countries/test_gambia.py (1 hunks)
  • tests/countries/test_guinea_bissau.py (1 hunks)
  • tests/countries/test_guyana.py (1 hunks)
  • tests/countries/test_ivory_coast.py (1 hunks)
  • tests/countries/test_mali.py (1 hunks)
  • tests/countries/test_mauritius.py (1 hunks)
  • tests/countries/test_sierra_leone.py (8 hunks)
  • tests/countries/test_suriname.py (1 hunks)
🧰 Additional context used
🧠 Learnings (32)
📓 Common learnings
Learnt from: KJhellico
PR: vacanza/holidays#2631
File: tests/countries/test_sint_maarten.py:62-0
Timestamp: 2025-06-14T21:12:07.224Z
Learning: KJhellico prefers to focus on completing and reviewing the main holiday implementation code before doing detailed reviews of the corresponding test files.
Learnt from: KJhellico
PR: vacanza/holidays#2833
File: tests/countries/test_uganda.py:15-0
Timestamp: 2025-08-20T19:46:15.595Z
Learning: In the holidays project, the standard import pattern for country test files is `from holidays.countries.<country> import Country, CODE1, CODE2` (direct module import), used by ~75% of country test files. Only a minority (~25%) use the aggregated public API import `from holidays.countries import Country, CODE1, CODE2`. The direct module import pattern should be used for new country test files to follow the established convention.
Learnt from: KJhellico
PR: vacanza/holidays#2778
File: tests/countries/test_kiribati.py:15-15
Timestamp: 2025-08-09T18:31:23.218Z
Learning: In the holidays project test files, the standard import pattern is `from holidays.countries.<country> import Country, CODE1, CODE2` (used in ~97% of test files), not `from holidays.countries import Country, CODE1, CODE2`. Only a few exceptions (Suriname, Sierra Leone, Mauritius, Mali, Ivory Coast, Guyana) use the aggregated import pattern.
Learnt from: KJhellico
PR: vacanza/holidays#2774
File: tests/countries/test_liberia.py:15-16
Timestamp: 2025-08-08T14:37:03.045Z
Learning: When adding a new country in vacanza/holidays, also re-export it in holidays/countries/__init__.py (e.g., from .liberia import Liberia, LR, LBR) so tests and users can import from holidays.countries consistently.
Learnt from: KJhellico
PR: vacanza/holidays#2774
File: tests/countries/test_liberia.py:15-16
Timestamp: 2025-08-08T14:37:03.045Z
Learning: In holidays/countries/__init__.py, re-export country classes using absolute imports (e.g., 'from holidays.countries.liberia import Liberia, LR, LBR') and keep alphabetical ordering (e.g., Lesotho, Liberia, Libya). Avoid relative imports in this file.
Learnt from: KJhellico
PR: vacanza/holidays#2398
File: holidays/countries/guinea.py:106-110
Timestamp: 2025-04-04T10:52:41.546Z
Learning: In the Guinea holidays implementation, observed Eid al-Fitr cases are properly covered by the test_eid_al_fitr_day() method, which tests both the regular holiday dates and the observed dates when the holiday falls on a non-working day (for years >= 2023).
📚 Learning: 2025-03-30T18:22:11.939Z
Learnt from: KJhellico
PR: vacanza/holidays#2388
File: holidays/countries/ivory_coast.py:127-128
Timestamp: 2025-03-30T18:22:11.939Z
Learning: The IvoryCoast class in holidays/countries/ivory_coast.py already includes documentation in its class docstring explaining the "day after" naming convention for Islamic holidays, noting that in the Islamic calendar, days begin at sunset and the "day after" refers to daylight hours following the night of celebration.

Applied to files:

  • tests/countries/test_ivory_coast.py
📚 Learning: 2025-08-09T18:31:23.218Z
Learnt from: KJhellico
PR: vacanza/holidays#2778
File: tests/countries/test_kiribati.py:15-15
Timestamp: 2025-08-09T18:31:23.218Z
Learning: In the holidays project test files, the standard import pattern is `from holidays.countries.<country> import Country, CODE1, CODE2` (used in ~97% of test files), not `from holidays.countries import Country, CODE1, CODE2`. Only a few exceptions (Suriname, Sierra Leone, Mauritius, Mali, Ivory Coast, Guyana) use the aggregated import pattern.

Applied to files:

  • tests/countries/test_ivory_coast.py
  • tests/countries/test_suriname.py
  • tests/countries/test_guinea_bissau.py
  • tests/countries/test_gambia.py
  • tests/countries/test_guyana.py
  • tests/countries/test_sierra_leone.py
  • tests/countries/test_mali.py
  • tests/countries/test_mauritius.py
📚 Learning: 2025-08-08T14:37:03.045Z
Learnt from: KJhellico
PR: vacanza/holidays#2774
File: tests/countries/test_liberia.py:15-16
Timestamp: 2025-08-08T14:37:03.045Z
Learning: When adding a new country in vacanza/holidays, also re-export it in holidays/countries/__init__.py (e.g., from .liberia import Liberia, LR, LBR) so tests and users can import from holidays.countries consistently.

Applied to files:

  • tests/countries/test_ivory_coast.py
  • tests/countries/test_suriname.py
  • tests/countries/test_guinea_bissau.py
  • tests/countries/test_gambia.py
  • tests/countries/test_guyana.py
  • tests/countries/test_sierra_leone.py
  • tests/countries/test_mali.py
  • tests/countries/test_mauritius.py
📚 Learning: 2025-08-08T14:37:03.045Z
Learnt from: KJhellico
PR: vacanza/holidays#2774
File: tests/countries/test_liberia.py:15-16
Timestamp: 2025-08-08T14:37:03.045Z
Learning: In holidays/countries/__init__.py, re-export country classes using absolute imports (e.g., 'from holidays.countries.liberia import Liberia, LR, LBR') and keep alphabetical ordering (e.g., Lesotho, Liberia, Libya). Avoid relative imports in this file.

Applied to files:

  • tests/countries/test_ivory_coast.py
  • tests/countries/test_suriname.py
  • tests/countries/test_guinea_bissau.py
  • tests/countries/test_gambia.py
  • tests/countries/test_guyana.py
  • tests/countries/test_sierra_leone.py
  • tests/countries/test_mali.py
  • tests/countries/test_mauritius.py
  • holidays/countries/sierra_leone.py
📚 Learning: 2025-06-16T15:48:48.680Z
Learnt from: PPsyrius
PR: vacanza/holidays#2615
File: tests/countries/test_anguilla.py:1-12
Timestamp: 2025-06-16T15:48:48.680Z
Learning: Test files in the holidays repository follow a standardized structure without module or class docstrings. All country test files use the same pattern: license header, imports, and class definition (`class Test{Country}(CommonCountryTests, TestCase):`) without docstrings. This is an established codebase convention that should be maintained for consistency.

Applied to files:

  • tests/countries/test_ivory_coast.py
  • tests/countries/test_suriname.py
  • tests/countries/test_guinea_bissau.py
  • tests/countries/test_gambia.py
  • tests/countries/test_guyana.py
  • tests/countries/test_sierra_leone.py
  • tests/countries/test_mali.py
  • tests/countries/test_mauritius.py
📚 Learning: 2025-08-20T19:46:15.595Z
Learnt from: KJhellico
PR: vacanza/holidays#2833
File: tests/countries/test_uganda.py:15-0
Timestamp: 2025-08-20T19:46:15.595Z
Learning: In the holidays project, the standard import pattern for country test files is `from holidays.countries.<country> import Country, CODE1, CODE2` (direct module import), used by ~75% of country test files. Only a minority (~25%) use the aggregated public API import `from holidays.countries import Country, CODE1, CODE2`. The direct module import pattern should be used for new country test files to follow the established convention.

Applied to files:

  • tests/countries/test_ivory_coast.py
  • tests/countries/test_suriname.py
  • tests/countries/test_guinea_bissau.py
  • tests/countries/test_gambia.py
  • tests/countries/test_guyana.py
  • tests/countries/test_sierra_leone.py
  • tests/countries/test_mali.py
  • tests/countries/test_mauritius.py
📚 Learning: 2025-06-16T11:42:28.293Z
Learnt from: PPsyrius
PR: vacanza/holidays#2638
File: holidays/countries/svalbard_and_jan_mayen.py:1-12
Timestamp: 2025-06-16T11:42:28.293Z
Learning: In the holidays library codebase, country implementation files in holidays/countries/ follow a standard convention of NOT having module-level docstrings. They start with the license header comment block, followed by imports, then class definitions. This is consistent across all country implementations like austria.py, belgium.py, canada.py, etc.

Applied to files:

  • tests/countries/test_ivory_coast.py
📚 Learning: 2025-04-05T04:29:38.042Z
Learnt from: PPsyrius
PR: vacanza/holidays#2416
File: tests/countries/test_turkmenistan.py:85-86
Timestamp: 2025-04-05T04:29:38.042Z
Learning: For testing holiday implementations in the vacanza/holidays repository, recommend using `from tests.common import CommonCountryTests` as the base class instead of directly using `unittest.TestCase` to maintain consistency with project conventions and leverage common test utilities.

Applied to files:

  • tests/countries/test_ivory_coast.py
  • tests/countries/test_suriname.py
  • tests/countries/test_guinea_bissau.py
  • tests/countries/test_gambia.py
  • tests/countries/test_guyana.py
  • tests/countries/test_sierra_leone.py
  • tests/countries/test_mali.py
  • tests/countries/test_mauritius.py
📚 Learning: 2025-04-05T04:50:40.752Z
Learnt from: PPsyrius
PR: vacanza/holidays#2416
File: tests/countries/test_turkmenistan.py:31-49
Timestamp: 2025-04-05T04:50:40.752Z
Learning: For Turkmenistan holiday tests, use this class structure: `class TestTurkmenistan(CommonCountryTests, TestCase)` with imports `from unittest import TestCase`, `from holidays.countries import Turkmenistan, TM, TKM`, and `from tests.common import CommonCountryTests`. Ensure to call `super().setUp()` in the setUp method.

Applied to files:

  • tests/countries/test_ivory_coast.py
  • tests/countries/test_suriname.py
  • tests/countries/test_guinea_bissau.py
  • tests/countries/test_gambia.py
  • tests/countries/test_guyana.py
  • tests/countries/test_sierra_leone.py
  • tests/countries/test_mali.py
  • tests/countries/test_mauritius.py
📚 Learning: 2025-04-05T04:33:53.254Z
Learnt from: PPsyrius
PR: vacanza/holidays#2416
File: tests/countries/test_turkmenistan.py:52-64
Timestamp: 2025-04-05T04:33:53.254Z
Learning: For Turkmenistan holiday tests, recommend using CommonCountryTests as the base class rather than unittest.TestCase to follow project conventions, be consistent with other country test files, and gain access to common test utilities.

Applied to files:

  • tests/countries/test_ivory_coast.py
  • tests/countries/test_suriname.py
  • tests/countries/test_guinea_bissau.py
  • tests/countries/test_gambia.py
  • tests/countries/test_guyana.py
  • tests/countries/test_sierra_leone.py
  • tests/countries/test_mali.py
  • tests/countries/test_mauritius.py
📚 Learning: 2025-05-06T21:07:11.577Z
Learnt from: KJhellico
PR: vacanza/holidays#2530
File: tests/countries/test_andorra.py:23-28
Timestamp: 2025-05-06T21:07:11.577Z
Learning: In the holidays project, test methods for country holidays follow a standard form where year ranges are explicitly recreated in each test method rather than being stored as class variables, to maintain consistency across all country tests.

Applied to files:

  • tests/countries/test_ivory_coast.py
  • tests/countries/test_suriname.py
  • tests/countries/test_guinea_bissau.py
  • tests/countries/test_gambia.py
  • tests/countries/test_guyana.py
  • tests/countries/test_sierra_leone.py
  • tests/countries/test_mali.py
  • tests/countries/test_mauritius.py
📚 Learning: 2025-06-18T17:01:58.067Z
Learnt from: PPsyrius
PR: vacanza/holidays#2642
File: tests/countries/test_wallis_and_futuna.py:19-23
Timestamp: 2025-06-18T17:01:58.067Z
Learning: In the vacanza/holidays repository, the standard pattern for test class setUpClass methods is `super().setUpClass(HolidayClass)` where HolidayClass is passed as the first argument. This is the correct signature used across all country test files.

Applied to files:

  • tests/countries/test_ivory_coast.py
  • tests/countries/test_suriname.py
  • tests/countries/test_mauritius.py
📚 Learning: 2025-07-24T15:21:31.632Z
Learnt from: PPsyrius
PR: vacanza/holidays#2750
File: tests/countries/test_germany.py:46-46
Timestamp: 2025-07-24T15:21:31.632Z
Learning: In the holidays project test files, the standard method name for testing the absence of holidays is `test_no_holidays`, not more descriptive names like `test_no_holidays_before_1990`. This is a consistent naming convention across country test files like France and Germany.

Applied to files:

  • tests/countries/test_ivory_coast.py
  • tests/countries/test_suriname.py
  • tests/countries/test_mauritius.py
📚 Learning: 2025-06-18T17:01:58.067Z
Learnt from: PPsyrius
PR: vacanza/holidays#2642
File: tests/countries/test_wallis_and_futuna.py:19-23
Timestamp: 2025-06-18T17:01:58.067Z
Learning: In the vacanza/holidays repository, the standard pattern for test class setUpClass methods is `super().setUpClass(HolidayClass)` or `super().setUpClass(HolidayClass, years=...)` where HolidayClass is passed as the first argument. This is the correct signature that matches the CommonCountryTests.setUpClass method which accepts test_class as the first parameter after cls. Pylint warnings about parameter count mismatch are false positives when comparing against TestCase.setUpClass instead of the immediate parent CommonCountryTests.setUpClass.

Applied to files:

  • tests/countries/test_suriname.py
  • tests/countries/test_mauritius.py
📚 Learning: 2025-04-04T10:52:41.546Z
Learnt from: KJhellico
PR: vacanza/holidays#2398
File: holidays/countries/guinea.py:106-110
Timestamp: 2025-04-04T10:52:41.546Z
Learning: In the Guinea holidays implementation, observed Eid al-Fitr cases are properly covered by the test_eid_al_fitr_day() method, which tests both the regular holiday dates and the observed dates when the holiday falls on a non-working day (for years >= 2023).

Applied to files:

  • tests/countries/test_guinea_bissau.py
  • tests/countries/test_sierra_leone.py
📚 Learning: 2025-04-04T10:52:41.546Z
Learnt from: KJhellico
PR: vacanza/holidays#2398
File: holidays/countries/guinea.py:106-110
Timestamp: 2025-04-04T10:52:41.546Z
Learning: In the Guinea holidays implementation, observed Eid al-Fitr cases are covered by the test_eid_al_fitr_day() method, which tests both regular holiday dates and the observed dates when the holiday falls on a non-working day (for years >= 2023).

Applied to files:

  • tests/countries/test_guinea_bissau.py
📚 Learning: 2025-07-02T18:21:59.302Z
Learnt from: KJhellico
PR: vacanza/holidays#2608
File: tests/countries/test_saint_vincent_and_the_grenadines.py:162-178
Timestamp: 2025-07-02T18:21:59.302Z
Learning: In the Saint Vincent and the Grenadines holiday tests, for holidays without observed rules that only require a single assertHolidayName call, pass the holiday name directly as a string literal rather than storing it in a variable first for cleaner, more concise code.

Applied to files:

  • tests/countries/test_sierra_leone.py
📚 Learning: 2025-07-02T18:17:53.342Z
Learnt from: KJhellico
PR: vacanza/holidays#2608
File: tests/countries/test_saint_vincent_and_the_grenadines.py:162-178
Timestamp: 2025-07-02T18:17:53.342Z
Learning: In the Saint Vincent and the Grenadines holidays implementation, New Year's Day is added without observed rules using `_add_new_years_day()` and should not include observed rule testing in its test method. Only holidays explicitly wrapped with `_add_observed()` have observed behavior.

Applied to files:

  • tests/countries/test_sierra_leone.py
📚 Learning: 2025-07-09T21:16:35.145Z
Learnt from: KJhellico
PR: vacanza/holidays#2623
File: tests/countries/test_christmas_island.py:136-146
Timestamp: 2025-07-09T21:16:35.145Z
Learning: In Christmas Island's holiday implementation, the test_christmas_day method cannot use assertNoNonObservedHoliday because in some years observed Christmas Day overlaps with Boxing Day when both holidays are moved due to weekend conflicts, causing the standard non-observed holiday check to fail inappropriately.

Applied to files:

  • tests/countries/test_sierra_leone.py
📚 Learning: 2025-04-05T04:47:27.213Z
Learnt from: PPsyrius
PR: vacanza/holidays#2416
File: tests/countries/test_turkmenistan.py:52-64
Timestamp: 2025-04-05T04:47:27.213Z
Learning: For holiday tests in the vacanza/holidays project, structure tests by individual holidays rather than by years. Each test method should focus on a specific holiday and test it across multiple years (from start_year through 2050) using helper methods like `assertHolidayName`. For fixed holidays, use generators like `(f"{year}-01-01" for year in range(1991, 2051))`. For movable holidays, specify individual dates for specific years followed by a range check.

Applied to files:

  • tests/countries/test_sierra_leone.py
📚 Learning: 2025-05-13T13:23:11.375Z
Learnt from: KJhellico
PR: vacanza/holidays#2483
File: holidays/countries/turks_and_caicos_islands.py:117-118
Timestamp: 2025-05-13T13:23:11.375Z
Learning: The holidays library uses `_add_christmas_day_two` method to add Boxing Day holiday, not `_add_boxing_day`.

Applied to files:

  • tests/countries/test_sierra_leone.py
📚 Learning: 2025-06-22T21:36:18.015Z
Learnt from: KJhellico
PR: vacanza/holidays#2671
File: tests/countries/test_libya.py:19-24
Timestamp: 2025-06-22T21:36:18.015Z
Learning: In the vacanza/holidays project, test classes for countries do not use docstrings. All test classes follow the same pattern: class declaration directly followed by classmethod def setUpClass(cls) without any docstrings for the class or methods.

Applied to files:

  • tests/countries/test_mauritius.py
📚 Learning: 2025-06-13T12:18:03.539Z
Learnt from: PPsyrius
PR: vacanza/holidays#2614
File: holidays/countries/guyana.py:78-90
Timestamp: 2025-06-13T12:18:03.539Z
Learning: The holidays codebase now uses the constructor signature pattern `__init__(self, *args, islamic_show_estimated: bool = True, **kwargs)` across country classes.

Applied to files:

  • holidays/countries/sierra_leone.py
📚 Learning: 2025-06-19T02:34:14.456Z
Learnt from: PPsyrius
PR: vacanza/holidays#2643
File: holidays/countries/mauritius.py:171-184
Timestamp: 2025-06-19T02:34:14.456Z
Learning: In the holidays library, `_CustomIslamicHolidays` subclasses follow a consistent pattern of NOT having docstrings. They go directly to defining date dictionaries, as evidenced by Malaysia, Singapore, UAE, and dozens of other country implementations.

Applied to files:

  • holidays/countries/sierra_leone.py
📚 Learning: 2025-04-03T16:58:27.175Z
Learnt from: Wasif-Shahzad
PR: vacanza/holidays#2409
File: holidays/countries/qatar.py:27-46
Timestamp: 2025-04-03T16:58:27.175Z
Learning: In the holidays library, method names like `_add_holiday_2nd_tue_of_feb()` and `_add_holiday_1st_sun_of_mar()` use calendar constants internally through parent class implementations even when these constants don't appear directly in the file. Removing imports that seem unused based on a simple text search could break functionality.

Applied to files:

  • holidays/countries/sierra_leone.py
📚 Learning: 2025-04-13T19:10:31.502Z
Learnt from: KJhellico
PR: vacanza/holidays#2465
File: holidays/countries/suriname.py:219-251
Timestamp: 2025-04-13T19:10:31.502Z
Learning: The `_CustomIslamicHolidays` classes in this project contain only exact verified holiday dates from reliable sources, rather than calculated or estimated future dates. This is by design to ensure accuracy, particularly for religious holidays that may follow lunar calendars or depend on local observations.

Applied to files:

  • holidays/countries/sierra_leone.py
📚 Learning: 2025-08-21T05:56:33.238Z
Learnt from: PPsyrius
PR: vacanza/holidays#2843
File: holidays/countries/burundi.py:15-16
Timestamp: 2025-08-21T05:56:33.238Z
Learning: In the holidays library, when importing Gregorian month constants from holidays.calendars.gregorian, only import the months that are actually used in the date data. For example, if Islamic holiday dates only reference JUN, JUL, SEP, OCT, then only import those specific constants rather than importing additional unused months.

Applied to files:

  • holidays/countries/sierra_leone.py
📚 Learning: 2025-08-21T04:51:16.392Z
Learnt from: PPsyrius
PR: vacanza/holidays#2843
File: holidays/countries/burundi.py:13-13
Timestamp: 2025-08-21T04:51:16.392Z
Learning: In the holidays library, country classes with localization support consistently use `from gettext import gettext as tr` import and wrap class-level attributes like `estimated_label`, `observed_label`, and `observed_estimated_label` with `tr()` calls. This is the standard library-wide practice for l10n-enabled entities and is required for proper string extraction when generating .po files.

Applied to files:

  • holidays/countries/sierra_leone.py
📚 Learning: 2025-08-21T04:56:03.711Z
Learnt from: PPsyrius
PR: vacanza/holidays#2843
File: holidays/countries/burundi.py:63-101
Timestamp: 2025-08-21T04:56:03.711Z
Learning: In the holidays library, countries with localization support consistently use tr() wrappers around holiday names when calling _add_* methods (e.g., self._add_new_years_day(tr("Holiday Name"))). This is the established pattern across United States, Thailand, and other l10n-enabled countries, contrary to any suggestion that translation is handled internally by _add_* methods.

Applied to files:

  • holidays/countries/sierra_leone.py
📚 Learning: 2025-06-19T02:34:18.382Z
Learnt from: PPsyrius
PR: vacanza/holidays#2643
File: holidays/countries/mauritius.py:144-169
Timestamp: 2025-06-19T02:34:18.382Z
Learning: Custom holiday classes that extend _CustomHinduHolidays, _CustomIslamicHolidays, _CustomBuddhistHolidays, etc. in the holidays library do not use docstrings. They follow a pattern of using only inline comments above date dictionaries, as seen in Malaysia, Singapore, UAE, and other country implementations.

Applied to files:

  • holidays/countries/sierra_leone.py
📚 Learning: 2025-08-21T04:56:03.711Z
Learnt from: PPsyrius
PR: vacanza/holidays#2843
File: holidays/countries/burundi.py:63-101
Timestamp: 2025-08-21T04:56:03.711Z
Learning: In the holidays library, countries with localization support DO use tr() wrappers around holiday names when calling _add_* methods. This is the correct pattern for l10n-enabled country implementations, contrary to previous learning about translation being handled internally by _add_* methods.

Applied to files:

  • holidays/countries/sierra_leone.py
🧬 Code graph analysis (9)
tests/countries/test_ivory_coast.py (1)
holidays/countries/ivory_coast.py (3)
  • IvoryCoast (25-132)
  • CI (135-136)
  • CIV (139-140)
tests/countries/test_suriname.py (1)
holidays/countries/suriname.py (3)
  • Suriname (27-142)
  • SR (145-146)
  • SUR (149-150)
tests/countries/test_guinea_bissau.py (1)
holidays/countries/guinea_bissau.py (3)
  • GuineaBissau (20-84)
  • GW (87-88)
  • GNB (91-92)
tests/countries/test_gambia.py (1)
holidays/countries/gambia.py (3)
  • Gambia (21-112)
  • GM (115-116)
  • GMB (119-120)
tests/countries/test_guyana.py (1)
holidays/countries/guyana.py (3)
  • Guyana (32-156)
  • GY (159-160)
  • GUY (163-164)
tests/countries/test_sierra_leone.py (2)
holidays/countries/sierra_leone.py (3)
  • SierraLeone (21-100)
  • SL (103-104)
  • SLE (107-108)
tests/common.py (1)
  • assertHolidayName (195-199)
tests/countries/test_mali.py (1)
holidays/countries/mali.py (3)
  • Mali (21-97)
  • ML (100-101)
  • MLI (104-105)
tests/countries/test_mauritius.py (1)
holidays/countries/mauritius.py (3)
  • Mauritius (28-128)
  • MU (131-132)
  • MUS (135-136)
holidays/countries/sierra_leone.py (1)
holidays/calendars/islamic.py (1)
  • _CustomIslamicHolidays (4085-4086)
🔇 Additional comments (11)
tests/countries/test_mali.py (1)

15-15: Approve per-country import for Mali
Per-country import in tests/countries/test_mali.py follows our established convention, and the re-export of Mali (Mali, ML, MLI) in holidays/countries/__init__.py has been confirmed for backward compatibility. No further action required.

tests/countries/test_gambia.py (1)

15-15: LGTM: unified import via holidays.countries.gambia.

Symbols Gambia, GM, and GMB exist in the module and this mirrors the dominant style across tests.

tests/countries/test_suriname.py (1)

15-15: LGTM: per-country import improves clarity.

Suriname, SR, and SUR are defined in holidays.countries.suriname; this change is purely organizational.

tests/countries/test_mauritius.py (1)

15-15: LGTM: direct import from holidays.countries.mauritius.

Matches the established convention; no behavior change.

tests/countries/test_ivory_coast.py (2)

12-12: No action: benign whitespace change after header.

Formatting-only; consistent with file header separation.


15-15: LGTM: switch to holidays.countries.ivory_coast import.

IvoryCoast, CI, and CIV are provided by the per-country module; this aligns with the unified import strategy.

tests/countries/test_guinea_bissau.py (1)

15-15: Per-country import aligns with project convention.

Switching to from holidays.countries.guinea_bissau import GuineaBissau, GW, GNB matches the prevailing test import style and the PR’s goal to unify imports. No logic impact.

tests/countries/test_guyana.py (1)

15-15: Import path unified to per-country module.

Good move to from holidays.countries.guyana import Guyana, GY, GUY. Consistent with the repo’s test conventions and this refactor’s scope.

holidays/countries/sierra_leone.py (1)

15-15: All set: _CustomIslamicHolidays is re-exported

– Verified that in holidays/calendars/__init__.py (line 22) we have
from holidays.calendars.islamic import _CustomIslamicHolidays
– No stale direct imports of _CustomIslamicHolidays remain elsewhere

Importing from holidays.calendars in holidays/countries/sierra_leone.py is safe.

tests/countries/test_sierra_leone.py (2)

15-15: Per-country import matches the unified pattern.

from holidays.countries.sierra_leone import SierraLeone, SL, SLE is consistent with the project’s preferred testing import style.


42-42: Observed-holiday assertions look correct and focused.

Asserting observed labels by explicit date tuples and pairing with assertNoNonObservedHoliday(dt) makes the intent clear and avoids fixture coupling for non-Islamic holidays. Nicely scoped to the PR’s objective.

Also applies to: 57-57, 69-69, 109-109, 122-122, 134-134, 146-146

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions bot added the test label Aug 21, 2025
@sonarqubecloud
Copy link

@codecov
Copy link

codecov bot commented Aug 21, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (5203f05) to head (03abf4c).
⚠️ Report is 1 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff            @@
##               dev     #2845   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          286       286           
  Lines        17038     17038           
  Branches      2229      2229           
=========================================
  Hits         17038     17038           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Collaborator

@arkid15r arkid15r left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@arkid15r arkid15r enabled auto-merge August 21, 2025 18:35
@arkid15r arkid15r added this pull request to the merge queue Aug 21, 2025
Merged via the queue into vacanza:dev with commit 3e277e9 Aug 21, 2025
84 of 88 checks passed
@KJhellico KJhellico deleted the ref-tests branch August 21, 2025 18:47
@arkid15r arkid15r mentioned this pull request Sep 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants