-
-
Notifications
You must be signed in to change notification settings - Fork 554
Update common::CommonTests
: expand label tests to financial entities
#2876
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Summary by CodeRabbit
WalkthroughAdds tests in Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro 💡 Knowledge Base configuration:
You can enable these sources in your CodeRabbit configuration. 📒 Files selected for processing (1)
🧰 Additional context used🧠 Learnings (14)📓 Common learnings
📚 Learning: 2025-04-05T04:29:38.042Z
Applied to files:
📚 Learning: 2025-08-24T13:01:51.370Z
Applied to files:
📚 Learning: 2025-06-16T15:48:48.680Z
Applied to files:
📚 Learning: 2025-07-24T15:21:31.632Z
Applied to files:
📚 Learning: 2025-04-02T18:38:35.164Z
Applied to files:
📚 Learning: 2025-04-05T04:33:53.254Z
Applied to files:
📚 Learning: 2025-04-05T04:50:40.752Z
Applied to files:
📚 Learning: 2025-08-24T13:01:51.370Z
Applied to files:
📚 Learning: 2025-08-26T20:10:05.288Z
Applied to files:
📚 Learning: 2025-08-28T02:34:11.625Z
Applied to files:
📚 Learning: 2025-08-19T14:42:45.111Z
Applied to files:
📚 Learning: 2025-08-25T04:28:02.061Z
Applied to files:
📚 Learning: 2025-06-18T10:07:58.780Z
Applied to files:
🧬 Code graph analysis (1)tests/common.py (1)
⏰ 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). (3)
✨ Finishing Touches
🧪 Generate unit tests
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
Status, Documentation and Community
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 2
📜 Review details
Configuration used: Path: .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.
📒 Files selected for processing (1)
tests/common.py
(1 hunks)
🧰 Additional context used
🧠 Learnings (9)
📓 Common learnings
Learnt from: Wasif-Shahzad
PR: vacanza/holidays#2852
File: tests/countries/test_tajikistan.py:26-28
Timestamp: 2025-08-24T13:01:51.370Z
Learning: In the holidays project country test files, the standard method name for testing country aliases (ISO codes) is `test_country_aliases`, not `test_aliases`. This naming convention is consistently used across all country test files.
Learnt from: Wasif-Shahzad
PR: vacanza/holidays#2852
File: tests/countries/test_tajikistan.py:26-28
Timestamp: 2025-08-24T13:01:51.370Z
Learning: In the holidays project country test files, the universally adopted standard method name for testing country aliases (ISO codes) is `test_country_aliases`. This naming convention is used consistently across all 235+ country test files in the repository, with no exceptions using `test_aliases`.
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.
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.
Learnt from: PPsyrius
PR: vacanza/holidays#2638
File: holidays/countries/svalbard_and_jan_mayen.py:26-32
Timestamp: 2025-06-16T11:46:35.303Z
Learning: When creating country holiday aliases that inherit from parent countries (like Svalbard and Jan Mayen from Norway, or Åland from Finland), it's standard practice to hardcode a specific subdivision code in the _populate methods since the subdivision codes for the parent country yield identical results. The Åland Islands implementation serves as the reference pattern for this approach.
📚 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/common.py
📚 Learning: 2025-08-24T13:01:51.370Z
Learnt from: Wasif-Shahzad
PR: vacanza/holidays#2852
File: tests/countries/test_tajikistan.py:26-28
Timestamp: 2025-08-24T13:01:51.370Z
Learning: In the holidays project country test files, the standard method name for testing country aliases (ISO codes) is `test_country_aliases`, not `test_aliases`. This naming convention is consistently used across all country test files.
Applied to files:
tests/common.py
📚 Learning: 2025-08-24T13:01:51.370Z
Learnt from: Wasif-Shahzad
PR: vacanza/holidays#2852
File: tests/countries/test_tajikistan.py:26-28
Timestamp: 2025-08-24T13:01:51.370Z
Learning: In the holidays project country test files, the universally adopted standard method name for testing country aliases (ISO codes) is `test_country_aliases`. This naming convention is used consistently across all 235+ country test files in the repository, with no exceptions using `test_aliases`.
Applied to files:
tests/common.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/common.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/common.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/common.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/common.py
📚 Learning: 2025-06-18T10:07:58.780Z
Learnt from: PPsyrius
PR: vacanza/holidays#2642
File: holidays/countries/french_southern_territories.py:41-44
Timestamp: 2025-06-18T10:07:58.780Z
Learning: Territorial holiday classes that inherit from parent countries (like HolidaysAX from Finland, HolidaysSJ from Norway, HolidaysTF from France) follow a standard pattern of silently overriding self.subdiv in their _populate_public_holidays() method without validation, as this ensures they always use the correct subdivision code for their territory regardless of user input.
Applied to files:
tests/common.py
🧬 Code graph analysis (1)
tests/common.py (1)
tests/test_holiday_base.py (1)
test_subdivisions_aliases
(188-205)
🪛 GitHub Actions: CI/CD
tests/common.py
[error] 360-360: AssertionError: None is not true : The observed_estimated_label
attribute is required for entities containing both observed_label
and estimated_label
.
🔇 Additional comments (1)
tests/common.py (1)
354-367
: All entities defineobserved_estimated_label
The verification script returned no classes missing this attribute, so the original CI failure warning appears outdated.Likely an incorrect or invalid review comment.
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #2876 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 294 294
Lines 17445 17445
Branches 2262 2262
=========================================
Hits 17445 17445 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
common::CommonTests
: expand lablel tests to financial entities
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 🛠️
common::CommonTests
: expand lablel tests to financial entitiescommon::CommonTests
: expand label tests to financial entities
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Proposed change
Update tests/common.py: expand lablel tests to financial entities
Type of change
holidays
functionality in general)Checklist
make check
locally; all checks and tests passed.