Skip to content

Refactor tests: long holiday names representation cleanup#3134

Merged
KJhellico merged 1 commit intovacanza:devfrom
KJhellico:ref-test-long-strings
Dec 15, 2025
Merged

Refactor tests: long holiday names representation cleanup#3134
KJhellico merged 1 commit intovacanza:devfrom
KJhellico:ref-test-long-strings

Conversation

@KJhellico
Copy link
Copy Markdown
Collaborator

Proposed change

Refactor tests: long holiday names representation cleanup.

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
Copy Markdown
Contributor

coderabbitai bot commented Dec 15, 2025

Summary by CodeRabbit

Release Notes

  • Tests
    • Updated test data structure for holiday name expectations across multiple countries (Belarus, Burundi, Cambodia, Laos, Spain, Tanzania, Thailand, Tonga, and United States) to standardize formatting. No changes to holiday data or user-facing functionality.

✏️ Tip: You can customize this high-level summary in your review settings.

Walkthrough

Test expectations across multiple country-specific holiday test files are converted from multi-part string tuples to single concatenated strings. All changes are formatting-only, preserving holiday names and dates without altering test logic or assertions.

Changes

Cohort / File(s) Summary
Holiday name formatting standardization
tests/countries/test_belarus.py, tests/countries/test_burundi.py, tests/countries/test_cambodia.py, tests/countries/test_laos.py, tests/countries/test_spain.py, tests/countries/test_tanzania.py, tests/countries/test_thailand.py, tests/countries/test_tonga.py, tests/countries/test_united_states.py
Updated expected holiday name values by converting multi-line string tuples to single concatenated strings across localization tests (default, en_US, th, uk, and others). String content remains identical; only structural format changes from tuple to string literal.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

  • Verify string concatenations produce identical output to original multi-part tuples across all test cases
  • Spot-check a few files to confirm no accidental whitespace or content changes during concatenation

Possibly related PRs

  • PR #2843: Related modifications to Burundi holiday test expectations and localization handling
  • PR #2722: Connected changes to United States holiday naming and test assertions
  • PR #2821: Overlapping updates to Tanzania holiday tests and localization expectations

Suggested labels

test

Suggested reviewers

  • arkid15r
  • PPsyrius

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately captures the main change: refactoring test files to clean up the representation of long holiday names from tuples to single concatenated strings.
Description check ✅ Passed The description relates to the changeset, noting it as a quality improvement and test refactoring, though it lacks specific details about the tuple-to-string conversions.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5f095a7 and 4bffdb5.

📒 Files selected for processing (9)
  • tests/countries/test_belarus.py (4 hunks)
  • tests/countries/test_burundi.py (4 hunks)
  • tests/countries/test_cambodia.py (4 hunks)
  • tests/countries/test_laos.py (3 hunks)
  • tests/countries/test_spain.py (1 hunks)
  • tests/countries/test_tanzania.py (2 hunks)
  • tests/countries/test_thailand.py (3 hunks)
  • tests/countries/test_tonga.py (6 hunks)
  • tests/countries/test_united_states.py (8 hunks)
🧰 Additional context used
🧠 Learnings (36)
📓 Common learnings
Learnt from: KJhellico
Repo: vacanza/holidays PR: 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: PPsyrius
Repo: vacanza/holidays PR: 2881
File: tests/countries/test_albania.py:40-42
Timestamp: 2025-09-04T08:54:35.319Z
Learning: In the vacanza/holidays project test files, extract holiday name strings to local variables only when they are reused multiple times within the same test method (e.g., used in both assertHolidayName and assertNoHolidayName calls). When a holiday name is used only once, keep it inline rather than extracting it to a variable for the sake of consistency.
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2881
File: tests/countries/test_french_polynesia.py:19-22
Timestamp: 2025-11-08T05:09:56.159Z
Learning: In the vacanza/holidays project's test framework (PR #2881 onwards), the base class CommonCountryTests provides a default test_no_holidays implementation that automatically tests years=start_year - 1 for standard PUBLIC category cases. Individual country test files should only override test_no_holidays when the country supports additional non-PUBLIC categories (GOVERNMENT, WORKDAY, OPTIONAL, etc.) with different start years requiring separate validation.
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 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.
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2881
File: tests/countries/test_faroe_islands.py:16-16
Timestamp: 2025-11-08T05:36:32.788Z
Learning: In PR #2881 onwards, the vacanza/holidays project moved to centralized alias testing via the `check_aliases` method in `tests/common.py`. Individual country test files no longer need to import country code aliases (e.g., FO, FRO for Faroe Islands) or define `test_country_aliases` methods. The common test framework automatically validates all aliases by dynamically importing them from the registry and calling `assertAliases`.
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 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.
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 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.
Learnt from: KJhellico
Repo: vacanza/holidays PR: 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.
Learnt from: KJhellico
Repo: vacanza/holidays PR: 2398
File: tests/countries/test_guinea.py:237-239
Timestamp: 2025-04-02T18:38:35.164Z
Learning: In the vacanza/holidays project, the method assertLocalizedHolidays in country test files should be called with positional parameters rather than named parameters to maintain consistency with the rest of the codebase.
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 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.
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2386
File: tests/countries/test_nepal.py:499-536
Timestamp: 2025-04-05T06:49:06.217Z
Learning: In the holidays project, test files follow a dual testing approach: individual methods test specific holidays across multiple years, while comprehensive year-specific tests (e.g., `test_2025`) verify all holidays for a specific year in a single assertion. Both approaches serve different testing purposes and complement each other.
Learnt from: KJhellico
Repo: vacanza/holidays PR: 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.
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 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.
Learnt from: KJhellico
Repo: vacanza/holidays PR: 2653
File: holidays/locale/th/LC_MESSAGES/TW.po:17-21
Timestamp: 2025-06-21T18:06:50.027Z
Learning: KJhellico's username includes a tilde character (~) as part of their nickname (appears as "~Jhellico" in Last-Translator headers), which is intentional formatting and not an error.
📚 Learning: 2025-09-20T12:21:50.877Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2881
File: tests/countries/test_belgium.py:28-30
Timestamp: 2025-09-20T12:21:50.877Z
Learning: Belgium holidays implementation currently lacks a start_year attribute. In tests/countries/test_belgium.py, do not suggest adding test_no_holidays methods that rely on start_year until the start_year attribute is introduced to Belgium's holiday implementation.

Applied to files:

  • tests/countries/test_belarus.py
  • tests/countries/test_burundi.py
📚 Learning: 2025-11-08T05:36:32.788Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2881
File: tests/countries/test_faroe_islands.py:16-16
Timestamp: 2025-11-08T05:36:32.788Z
Learning: In PR #2881 onwards, the vacanza/holidays project moved to centralized alias testing via the `check_aliases` method in `tests/common.py`. Individual country test files no longer need to import country code aliases (e.g., FO, FRO for Faroe Islands) or define `test_country_aliases` methods. The common test framework automatically validates all aliases by dynamically importing them from the registry and calling `assertAliases`.

Applied to files:

  • tests/countries/test_belarus.py
  • tests/countries/test_laos.py
  • tests/countries/test_tonga.py
  • tests/countries/test_tanzania.py
  • tests/countries/test_spain.py
  • tests/countries/test_united_states.py
📚 Learning: 2025-11-08T05:09:56.159Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2881
File: tests/countries/test_french_polynesia.py:19-22
Timestamp: 2025-11-08T05:09:56.159Z
Learning: In the vacanza/holidays project's test framework (PR #2881 onwards), the base class CommonCountryTests provides a default test_no_holidays implementation that automatically tests years=start_year - 1 for standard PUBLIC category cases. Individual country test files should only override test_no_holidays when the country supports additional non-PUBLIC categories (GOVERNMENT, WORKDAY, OPTIONAL, etc.) with different start years requiring separate validation.

Applied to files:

  • tests/countries/test_belarus.py
  • tests/countries/test_laos.py
  • tests/countries/test_tonga.py
  • tests/countries/test_tanzania.py
  • tests/countries/test_burundi.py
  • tests/countries/test_united_states.py
📚 Learning: 2025-08-28T02:34:11.657Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2860
File: holidays/groups/eastern.py:36-36
Timestamp: 2025-08-28T02:34:11.657Z
Learning: The default estimated_label change from "%s (estimated)" to "%s" in holidays/groups/eastern.py is intentional to remove English-only fallback text from localized holiday names. Countries that need estimated labels should define them properly with localization support rather than relying on the English fallback.

Applied to files:

  • tests/countries/test_belarus.py
  • tests/countries/test_laos.py
  • tests/countries/test_spain.py
  • tests/countries/test_united_states.py
📚 Learning: 2025-06-25T10:36:39.909Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2678
File: tests/countries/test_united_states_virgin_islands.py:59-84
Timestamp: 2025-06-25T10:36:39.909Z
Learning: In the holidays library, test methods typically do not have docstrings. Only special test methods that need specific explanation (like edge cases or unique behaviors) have docstrings. Regular test methods like test_l10n_default, test_l10n_th, test_government_holidays, etc. should not have docstrings added.

Applied to files:

  • tests/countries/test_belarus.py
  • tests/countries/test_tonga.py
📚 Learning: 2025-07-24T15:21:31.632Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 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_belarus.py
  • tests/countries/test_tonga.py
  • tests/countries/test_cambodia.py
  • tests/countries/test_thailand.py
  • tests/countries/test_burundi.py
  • tests/countries/test_united_states.py
📚 Learning: 2025-04-02T18:38:35.164Z
Learnt from: KJhellico
Repo: vacanza/holidays PR: 2398
File: tests/countries/test_guinea.py:237-239
Timestamp: 2025-04-02T18:38:35.164Z
Learning: In the vacanza/holidays project, the method assertLocalizedHolidays in country test files should be called with positional parameters rather than named parameters to maintain consistency with the rest of the codebase.

Applied to files:

  • tests/countries/test_belarus.py
  • tests/countries/test_laos.py
  • tests/countries/test_cambodia.py
  • tests/countries/test_thailand.py
  • tests/countries/test_burundi.py
  • tests/countries/test_united_states.py
📚 Learning: 2025-07-02T18:21:59.302Z
Learnt from: KJhellico
Repo: vacanza/holidays PR: 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_belarus.py
  • tests/countries/test_tonga.py
  • tests/countries/test_cambodia.py
  • tests/countries/test_thailand.py
  • tests/countries/test_burundi.py
📚 Learning: 2025-09-28T05:42:12.777Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2881
File: tests/countries/test_indonesia.py:221-223
Timestamp: 2025-09-28T05:42:12.777Z
Learning: In tests/countries/test_indonesia.py, the manual set inclusion checks using get_named and years_found for Lunar New Year (test_lunar_new_year) and Vesak Day (test_vesak_day) are intentional and should remain until both holidays get their own `{insert}_no_estimated` flags implemented, rather than using standard harness assertions like assertHolidayName/assertNoHolidayName.

Applied to files:

  • tests/countries/test_belarus.py
  • tests/countries/test_laos.py
  • tests/countries/test_tonga.py
  • tests/countries/test_cambodia.py
  • tests/countries/test_tanzania.py
  • tests/countries/test_thailand.py
  • tests/countries/test_burundi.py
  • tests/countries/test_united_states.py
📚 Learning: 2025-09-17T15:16:16.192Z
Learnt from: KJhellico
Repo: vacanza/holidays PR: 2944
File: holidays/countries/myanmar.py:183-191
Timestamp: 2025-09-17T15:16:16.192Z
Learning: The special_public_holidays formatting pattern in the holidays codebase follows a consistent convention: single entries per year use flat tuple format like `2024: (MONTH, DAY, name)`, while multiple entries per year use tuple-of-tuples format like `2024: ((MONTH, DAY, name), (MONTH, DAY, name))`. This pattern is used consistently across all countries.

Applied to files:

  • tests/countries/test_belarus.py
  • tests/countries/test_laos.py
  • tests/countries/test_tonga.py
  • tests/countries/test_tanzania.py
  • tests/countries/test_thailand.py
  • tests/countries/test_burundi.py
  • tests/countries/test_spain.py
  • tests/countries/test_united_states.py
📚 Learning: 2025-08-08T14:37:03.045Z
Learnt from: KJhellico
Repo: vacanza/holidays PR: 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_laos.py
📚 Learning: 2025-09-14T17:17:14.387Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2881
File: tests/countries/test_saint_helena_ascension_and_tristan_da_cunha.py:209-209
Timestamp: 2025-09-14T17:17:14.387Z
Learning: In tests/countries/test_saint_helena_ascension_and_tristan_da_cunha.py, the explicit loop iteration pattern for subdivision-specific holiday checks (like Anniversary Day for TA subdivision) is intentionally preferred over using assertSubdivTa helper methods, as confirmed by PPsyrius.

Applied to files:

  • tests/countries/test_laos.py
  • tests/countries/test_tonga.py
  • tests/countries/test_tanzania.py
  • tests/countries/test_thailand.py
  • tests/countries/test_burundi.py
📚 Learning: 2025-09-18T03:19:23.722Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2881
File: tests/countries/test_algeria.py:28-30
Timestamp: 2025-09-18T03:19:23.722Z
Learning: In the vacanza/holidays project, tests now use self.start_year and self.end_year from the TestCase class instead of country-specific aliases (like DZ.start_year) for start_year and end_year references. This approach provides the test framework with better control over test year ranges rather than being tied to specific country start years.

Applied to files:

  • tests/countries/test_laos.py
  • tests/countries/test_cambodia.py
  • tests/countries/test_tanzania.py
  • tests/countries/test_burundi.py
  • tests/countries/test_spain.py
📚 Learning: 2025-05-06T21:07:11.577Z
Learnt from: KJhellico
Repo: vacanza/holidays PR: 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_laos.py
  • tests/countries/test_tonga.py
  • tests/countries/test_cambodia.py
  • tests/countries/test_tanzania.py
📚 Learning: 2025-11-27T13:47:31.850Z
Learnt from: KJhellico
Repo: vacanza/holidays PR: 3088
File: tests/countries/test_dr_congo.py:55-65
Timestamp: 2025-11-27T13:47:31.850Z
Learning: In DR Congo's holiday implementation (tests/countries/test_dr_congo.py), the test_national_hero_patrice_emery_lumumba_day method cannot use assertNoNonObservedHoliday because when Jan 17 is observed on Jan 16 (in years 2016, 2021), that date already has another holiday: "Journée du héros national Laurent Désiré Kabila" (Jan 16). The observed holiday overlaps with an existing non-observed holiday, making the standard non-observed holiday check inappropriate.
<!--

Applied to files:

  • tests/countries/test_laos.py
📚 Learning: 2025-06-16T15:48:48.680Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 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_tonga.py
📚 Learning: 2025-09-04T08:54:35.319Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2881
File: tests/countries/test_albania.py:40-42
Timestamp: 2025-09-04T08:54:35.319Z
Learning: In the vacanza/holidays project test files, extract holiday name strings to local variables only when they are reused multiple times within the same test method (e.g., used in both assertHolidayName and assertNoHolidayName calls). When a holiday name is used only once, keep it inline rather than extracting it to a variable for the sake of consistency.

Applied to files:

  • tests/countries/test_tonga.py
  • tests/countries/test_cambodia.py
  • tests/countries/test_thailand.py
  • tests/countries/test_united_states.py
📚 Learning: 2025-03-19T16:53:00.375Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2354
File: holidays/countries/fiji.py:185-188
Timestamp: 2025-03-19T16:53:00.375Z
Learning: In the Fiji holidays implementation, the `special_public_holidays_observed` dictionary in `FijiStaticHolidays` is only used for exceptions to the normal observance rules, not for documenting all holidays. Only 2019's Constitution Day needed a special entry as it didn't follow the standard patterns.

Applied to files:

  • tests/countries/test_tonga.py
  • tests/countries/test_thailand.py
  • tests/countries/test_united_states.py
📚 Learning: 2025-07-10T03:36:16.461Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2706
File: holidays/countries/cayman_islands.py:80-97
Timestamp: 2025-07-10T03:36:16.461Z
Learning: In the holidays library, date dictionaries that map years to specific dates (like queens_birthday_dates, spring_bank_dates, thanksgiving_day_dates, etc.) are typically defined within the _populate_public_holidays method rather than as module-level constants. This is the established library-wide pattern seen across multiple country implementations including United Kingdom, United States, Sri Lanka, and others.

Applied to files:

  • tests/countries/test_tonga.py
  • tests/countries/test_united_states.py
📚 Learning: 2025-03-29T15:15:05.919Z
Learnt from: KJhellico
Repo: vacanza/holidays PR: 2354
File: holidays/countries/fiji.py:171-183
Timestamp: 2025-03-29T15:15:05.919Z
Learning: In the Fiji holidays implementation, the maintainers are aware of the need to extend the MAWLID_DATES dictionary beyond 2025 when future official references become available, and will do so when appropriate. No suggestions about extending this dictionary should be made in future reviews.

Applied to files:

  • tests/countries/test_tonga.py
📚 Learning: 2025-04-05T04:47:27.213Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 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_cambodia.py
  • tests/countries/test_tanzania.py
  • tests/countries/test_thailand.py
  • tests/countries/test_burundi.py
  • tests/countries/test_united_states.py
📚 Learning: 2025-06-15T11:52:39.572Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2601
File: tests/countries/test_mongolia.py:128-156
Timestamp: 2025-06-15T11:52:39.572Z
Learning: In the vacanza/holidays project tests, when testing holidays that span multiple consecutive days across many years (like Mongolia's National Festival spanning July 11-13), prefer explicit for loops over complex nested generator expressions with unpacking. The explicit loops are more readable, easier to maintain, and better communicate the testing intent even though the Big O complexity is equivalent.

Applied to files:

  • tests/countries/test_cambodia.py
📚 Learning: 2025-04-05T06:49:06.217Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2386
File: tests/countries/test_nepal.py:499-536
Timestamp: 2025-04-05T06:49:06.217Z
Learning: In the holidays project, test files follow a dual testing approach: individual methods test specific holidays across multiple years, while comprehensive year-specific tests (e.g., `test_2025`) verify all holidays for a specific year in a single assertion. Both approaches serve different testing purposes and complement each other.

Applied to files:

  • tests/countries/test_tanzania.py
📚 Learning: 2025-11-28T02:24:17.418Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 3088
File: tests/countries/test_gabon.py:88-110
Timestamp: 2025-11-28T02:24:17.418Z
Learning: For Gabon's holiday implementation (tests/countries/test_gabon.py), all Islamic holiday dates are currently estimates. Therefore, the correct test pattern is to use assertIslamicNoEstimatedHolidayName for both specific known dates and the full range (e.g., test_eid_al_fitr and test_eid_al_adha), rather than using assertHolidayName for specific dates followed by assertIslamicNoEstimatedHolidayName for the range.

Applied to files:

  • tests/countries/test_tanzania.py
📚 Learning: 2025-08-15T19:16:14.119Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2821
File: holidays/countries/tanzania.py:37-83
Timestamp: 2025-08-15T19:16:14.119Z
Learning: PDF filenames in government holiday documentation may not always reflect the actual year covered in the content. The Tanzania Bank of Tanzania (BOT) 2024 public holidays document is hosted at a URL containing "2023" in the filename but contains 2024 holiday information.

Applied to files:

  • tests/countries/test_tanzania.py
📚 Learning: 2025-08-26T09:43:38.329Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2821
File: holidays/countries/tanzania.py:145-163
Timestamp: 2025-08-26T09:43:38.329Z
Learning: In the Tanzania holidays implementation, when multiple holidays fall on the same date (like Eid al-Fitr and Mwalimu Nyerere Day on 2007-10-14), the observed rule logic correctly applies to all holidays on that date. The SAT_SUN_TO_NEXT_MON_TUE rule for the first Eid day doesn't create issues with co-occurring holidays because in practice, such collisions occur on Sundays where both SAT_SUN_TO_NEXT_MON and SAT_SUN_TO_NEXT_MON_TUE rules yield identical results (both move to Monday).

Applied to files:

  • tests/countries/test_tanzania.py
📚 Learning: 2025-08-21T04:56:03.780Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2843
File: holidays/countries/burundi.py:63-101
Timestamp: 2025-08-21T04:56:03.780Z
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:

  • tests/countries/test_thailand.py
  • tests/countries/test_united_states.py
📚 Learning: 2025-09-25T10:05:04.107Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2959
File: tests/countries/test_myanmar.py:398-434
Timestamp: 2025-09-25T10:05:04.107Z
Learning: In the holidays library Thai localizations, there are two distinct patterns: 1) "%s (observed)" holidays use "ชดเชย%s" format, and 2) "Day off (substituted from %s)" holidays use "วันหยุด (แทน %s)" format. These serve different purposes and should not be confused - substituted holidays are not the same as observed holidays.

Applied to files:

  • tests/countries/test_thailand.py
  • tests/countries/test_united_states.py
📚 Learning: 2025-09-17T15:15:24.269Z
Learnt from: KJhellico
Repo: vacanza/holidays PR: 2944
File: holidays/countries/myanmar.py:112-121
Timestamp: 2025-09-17T15:15:24.269Z
Learning: The Myanmar government's "continuous public days for 2024-2025" policy specifically covers Tabaung and Tazaungmon full moon days by bridging gaps with weekends, but does not apply to Myanmar New Year (Thingyan) extra days, which follow a separate policy that correctly uses `self._year >= 2024`.

Applied to files:

  • tests/countries/test_thailand.py
📚 Learning: 2025-08-21T05:08:05.177Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2843
File: tests/countries/test_burundi.py:194-196
Timestamp: 2025-08-21T05:08:05.177Z
Learning: For Burundi holidays in fr_BI locale, the official government source (presidence.gov.bi) confirms that Islamic holidays use the transliterations "Aid-El-Adha" and "Aid-El-Fithr" rather than the more common French forms "Aïd al-Adha"/"Aïd el-Adha". This is the authoritative spelling for Burundian French as documented in official governmental holiday lists.

Applied to files:

  • tests/countries/test_burundi.py
📚 Learning: 2025-11-27T13:48:37.538Z
Learnt from: KJhellico
Repo: vacanza/holidays PR: 3088
File: tests/countries/test_dr_congo.py:162-168
Timestamp: 2025-11-27T13:48:37.538Z
Learning: In DR Congo's holiday implementation (tests/countries/test_dr_congo.py), the test_congolese_genocide_memorial_day method cannot use assertNoNonObservedHoliday because when Aug 2 is observed on Aug 1 (in year 2026), that date already has another holiday: "Fête des parents" (Aug 1). The observed holiday overlaps with an existing non-observed holiday, making the standard non-observed holiday check inappropriate.

Applied to files:

  • tests/countries/test_burundi.py
📚 Learning: 2025-09-14T16:03:13.558Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2881
File: tests/countries/test_barbados.py:21-23
Timestamp: 2025-09-14T16:03:13.558Z
Learning: In tests/countries/test_barbados.py, using years_non_observed=range(2000, 2024) is intentional because all observed holiday examples fall within 2001-2023, making this range appropriate for limiting testing to years where observed holidays actually exist in the test data.

Applied to files:

  • tests/countries/test_burundi.py
📚 Learning: 2025-03-06T12:36:48.071Z
Learnt from: KJhellico
Repo: vacanza/holidays PR: 2297
File: holidays/countries/united_states.py:528-534
Timestamp: 2025-03-06T12:36:48.071Z
Learning: Georgia and Indiana commemorate Washington's Birthday on December 24, not in February like the federal holiday. This is why the code uses Christmas Day as a reference point with the GA_IN_WASHINGTON_BIRTHDAY rule.

Applied to files:

  • tests/countries/test_united_states.py
📚 Learning: 2025-04-23T09:22:41.753Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2489
File: holidays/countries/sao_tome_and_principe.py:86-88
Timestamp: 2025-04-23T09:22:41.753Z
Learning: For holiday definitions in the holidays package, keep comments simple with just the holiday name (e.g., "# Independence Day.") rather than including dates or historical context, as the function names already encode the date information.

Applied to files:

  • tests/countries/test_united_states.py
📚 Learning: 2025-03-19T16:54:58.657Z
Learnt from: PPsyrius
Repo: vacanza/holidays PR: 2354
File: holidays/countries/fiji.py:146-159
Timestamp: 2025-03-19T16:54:58.657Z
Learning: In the holidays library implementation, explicit holiday dates (like Diwali in Fiji) are only defined for historical years with official sources (2016-2025). Future dates beyond the explicitly defined range are automatically calculated by methods like `_add_diwali`, which provide approximations when official dates aren't yet available.

Applied to files:

  • tests/countries/test_united_states.py
🪛 Ruff (0.14.8)
tests/countries/test_belarus.py

408-408: String contains ambiguous г (CYRILLIC SMALL LETTER GHE). Did you mean r (LATIN SMALL LETTER R)?

(RUF001)


408-408: String contains ambiguous е (CYRILLIC SMALL LETTER IE). Did you mean e (LATIN SMALL LETTER E)?

(RUF001)


408-408: String contains ambiguous р (CYRILLIC SMALL LETTER ER). Did you mean p (LATIN SMALL LETTER P)?

(RUF001)


408-408: String contains ambiguous б (CYRILLIC SMALL LETTER BE). Did you mean 6 (DIGIT SIX)?

(RUF001)


408-408: String contains ambiguous а (CYRILLIC SMALL LETTER A). Did you mean a (LATIN SMALL LETTER A)?

(RUF001)


408-408: String contains ambiguous і (CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I). Did you mean i (LATIN SMALL LETTER I)?

(RUF001)


471-471: String contains ambiguous г (CYRILLIC SMALL LETTER GHE). Did you mean r (LATIN SMALL LETTER R)?

(RUF001)


471-471: String contains ambiguous е (CYRILLIC SMALL LETTER IE). Did you mean e (LATIN SMALL LETTER E)?

(RUF001)


471-471: String contains ambiguous р (CYRILLIC SMALL LETTER ER). Did you mean p (LATIN SMALL LETTER P)?

(RUF001)


471-471: String contains ambiguous б (CYRILLIC SMALL LETTER BE). Did you mean 6 (DIGIT SIX)?

(RUF001)


471-471: String contains ambiguous а (CYRILLIC SMALL LETTER A). Did you mean a (LATIN SMALL LETTER A)?

(RUF001)

⏰ Context from checks skipped due to timeout of 300000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: Test Python 3.12 on windows-latest
  • GitHub Check: Test Python 3.14 on windows-latest
  • GitHub Check: Test Python 3.11 on windows-latest
  • GitHub Check: Test Python 3.13 on windows-latest
  • GitHub Check: Test Python 3.10 on windows-latest
🔇 Additional comments (23)
tests/countries/test_laos.py (3)

375-378: Laos l10n default long-name merge looks good

Single combined string for 2022‑07‑13 preserves all components and delimiters; spacing is correct.


415-419: Laos en_US combined description is consistent

The concatenated English description for 2022‑07‑13 keeps the same clauses with proper ; separators and spacing.


456-459: Laos Thai localization string is cleanly consolidated

The Thai long name for 2022‑07‑13 is now a single logical string; joins are at phrase boundaries with correct spacing.

tests/countries/test_tonga.py (1)

162-165: Tonga coronation long names remain correct across years

All updated holiday name literals for HM King George Tupou I’s coronation (and observed variants) are now single logical strings; wording and (fakatokanga'i) suffix are consistent for each year.

Also applies to: 185-188, 206-209, 231-234, 253-256, 275-277

tests/countries/test_spain.py (1)

1299-1302: Spain 2023‑09‑08 multi-holiday label is correctly consolidated

The Spanish description now uses a single, semicolon‑separated string listing Asturias, Extremadura, and Virgen de la Victoria; formatting matches other entries.

tests/countries/test_tanzania.py (2)

327-330: Tanzania 2022 Karume memorial long name matches canonical form

The 2022‑04‑07 entry reuses the full Swahili title from the dedicated Karume test; concatenation keeps spacing and line breaks safe.


356-359: Tanzania 2023 Good Friday + Karume combo label is consistent

The l10n default now uses a single semicolon‑separated string for “Ijumaa Kuu” plus the Karume memorial, aligning with en_US naming and other multi‑holiday days.

tests/countries/test_burundi.py (3)

213-216: Burundi 2024 patriotism/Nkurunziza entries correctly inlined

For 2024‑06‑08 and its observed 2024‑10‑14, the long French strings are now expressed as single logical values, consistent with the earlier name definition.

Also applies to: 227-229


250-253: Burundi 2025 patriotism/Nkurunziza French text is consistent

The 2025‑06‑08 and 2025‑06‑09 labels reuse the same full French phrasing (with “(observé)” only where applicable); concatenation is clean.

Also applies to: 255-258


286-289: Burundi en_US localization for patriotism/Nkurunziza day is well-consolidated

English names for 2025‑06‑08 and 2025‑06‑09 now each use one semicolon‑free sentence with an “(observed)” suffix only on the second date; wording matches the French intent.

Also applies to: 291-294

tests/countries/test_cambodia.py (3)

57-61: Cambodia Khmer long holiday names are normalized without semantic change

The 2022‑10‑15, 2022‑10‑29, 2023‑10‑15, and 2023‑10‑29 Khmer entries now use single concatenated strings; phrases, ordering, and punctuation all match the earlier multi‑piece versions.

Also applies to: 63-67, 91-95, 97-101


353-357: Cambodia l10n_default uses the same Khmer phrasing as year-specific tests

The localized expectations for 2023‑10‑15 and 2023‑10‑29 mirror the strings in test_2023, just flattened into single logical values, which keeps year tests and l10n tests in sync.

Also applies to: 359-363


408-411: Cambodia Thai localizations are cleanly consolidated

Thai descriptions for the King’s birthday and memorial/mourning days are now each expressed as one string (with adjacency for line‑wrapping only); wording remains unchanged and matches Khmer/en_US meaning.

Also applies to: 417-420, 423-425

tests/countries/test_belarus.py (4)

407-410: Belarus national symbols day (be) long label is correctly flattened

The Belarusian l10n_default text for 2022‑05‑08 is now one string; the three state symbols are still listed with commas and conjunction exactly as before. Ruff’s ambiguous‑Unicode warnings here are benign given this is Belarusian Cyrillic.


426-429: Belarus en_US Fatherland defenders day wording preserved

The English 2022‑02‑23 label is now a single string spanning two literals; spacing around “and the Armed Forces of the Republic of Belarus” remains correct.


440-444: Belarus en_US national symbols day long name looks correct

The long English description for 2022‑05‑08 is fully in one value, keeping the three-part “coat of arms / flag / anthem” phrasing with natural commas and spaces.


471-473: Belarus Russian national symbols day long name is consistent

The Russian 2022‑05‑08 label is likewise consolidated; it matches the Belarusian version structurally and uses proper Cyrillic text despite Ruff’s confusable-character hint.

tests/countries/test_thailand.py (4)

974-977: Thailand Rama X birthday (th) long title is nicely consolidated

The 2022‑07‑28 Thai name is now a single logical string; the split between literals is only for line length, and the royal title text is unchanged.


991-994: Thailand 2022‑12‑05 Thai combined label reads correctly

Joining the King’s birthday, National Day, and National Father’s Day into one semicolon‑separated Thai string matches how multi‑holiday days are represented elsewhere.


1044-1047: Thailand en_US 2022‑12‑05 multi-holiday name is consistent

The English localization now has a single string listing HM King Bhumibol’s birthday, National Day, and National Father’s Day; punctuation and spacing look good.


1097-1100: Thailand Ukrainian 2022‑12‑05 label is correctly flattened

The Ukrainian text keeps all three parts (National Day, Father’s Day, birthday anniversary) in one value with ; separators, matching the en_US semantics.

tests/countries/test_united_states.py (2)

2184-2286: Long English l10n name lists are cleanly flattened and delimiters look correct

The four updated entries (2022‑01‑17, 02‑21, 10‑10, 11‑25) are now single semicolon‑separated strings with consistent "; " delimiters and no trailing semicolons. Implicit literal concatenation plus the explicit trailing spaces keeps names from running together, and the assertLocalizedHolidays call remains positional and consistent with the rest of the suite.

Looks good and aligns with the PR’s goal of cleaning up long holiday name representations.


2288-2386: Thai l10n concatenation mirrors the English cleanup and keeps separators intact

Same story here for the Thai block: the long lists for 2022‑01‑17, 02‑21, 10‑10, and 11‑25 are flattened into single strings, with semicolon‑plus‑space separators preserved between entries and no separator at the end. The ordering and grouping match the English side conceptually, and the assertLocalizedHolidays("th", …) usage stays in the established positional style.

Change is purely representational and looks solid.


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

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov
Copy link
Copy Markdown

codecov bot commented Dec 15, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (5f095a7) to head (4bffdb5).
⚠️ Report is 1 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff            @@
##               dev     #3134   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files          306       306           
  Lines        18167     18167           
  Branches      2301      2301           
=========================================
  Hits         18167     18167           

☔ 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.

@KJhellico KJhellico enabled auto-merge December 15, 2025 13:16
Copy link
Copy Markdown
Collaborator

@PPsyrius PPsyrius left a comment

Choose a reason for hiding this comment

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

LGTM 🛠️

@KJhellico KJhellico added this pull request to the merge queue Dec 15, 2025
Merged via the queue into vacanza:dev with commit 7fd1e40 Dec 15, 2025
31 checks passed
@KJhellico KJhellico deleted the ref-test-long-strings branch December 15, 2025 13:43
@sonarqubecloud
Copy link
Copy Markdown

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