Skip to content

Conversation

@akx
Copy link
Member

@akx akx commented Dec 25, 2025

This PR follows up on #1241 to unwrap remaining unittest.TestCases to use Pytest fixtures.

@codecov
Copy link

codecov bot commented Dec 25, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.05%. Comparing base (d249286) to head (b3fcb5b).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1240   +/-   ##
=======================================
  Coverage   92.05%   92.05%           
=======================================
  Files          27       27           
  Lines        4680     4680           
=======================================
  Hits         4308     4308           
  Misses        372      372           
Flag Coverage Δ
macos-14-3.10 91.08% <ø> (ø)
macos-14-3.11 91.02% <ø> (ø)
macos-14-3.12 91.23% <ø> (ø)
macos-14-3.13 91.23% <ø> (ø)
macos-14-3.14 91.21% <ø> (ø)
macos-14-3.8 90.95% <ø> (ø)
macos-14-3.9 91.01% <ø> (ø)
macos-14-pypy3.10 91.08% <ø> (ø)
ubuntu-24.04-3.10 91.11% <ø> (ø)
ubuntu-24.04-3.11 91.04% <ø> (ø)
ubuntu-24.04-3.12 91.26% <ø> (ø)
ubuntu-24.04-3.13 91.26% <ø> (ø)
ubuntu-24.04-3.14 91.23% <ø> (ø)
ubuntu-24.04-3.8 90.97% <ø> (ø)
ubuntu-24.04-3.9 91.04% <ø> (ø)
ubuntu-24.04-pypy3.10 91.11% <ø> (ø)
windows-2022-3.10 91.10% <ø> (ø)
windows-2022-3.11 91.03% <ø> (ø)
windows-2022-3.12 91.25% <ø> (ø)
windows-2022-3.13 91.25% <ø> (ø)
windows-2022-3.14 91.22% <ø> (ø)
windows-2022-3.8 91.07% <ø> (ø)
windows-2022-3.9 91.03% <ø> (ø)
windows-2022-pypy3.10 91.10% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@akx akx force-pushed the unwrap-testcases branch 2 times, most recently from 63185e8 to c06b041 Compare December 25, 2025 15:22
@akx akx requested a review from Copilot December 25, 2025 15:23
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR modernizes the test suite by converting unittest.TestCase-based tests to plain pytest functions. The main changes include:

  • Replacing setUp()/tearDown() methods with pytest fixtures
  • Converting class-based tests to standalone functions
  • Splitting files with multiple TestCase classes into separate modules
  • Creating a new tests/messages/frontend/ package to organize frontend-related tests

Reviewed changes

Copilot reviewed 24 out of 25 changed files in this pull request and generated no comments.

Show a summary per file
File Description
tests/test_util.py Converted FixedOffsetTimezoneTestCase class to standalone test functions
tests/test_plural_rule_parser.py New file containing plural rule parser tests extracted from test_plural.py
tests/test_plural.py Removed PluralRuleParserTestCase, extracted tests to new file, converted TestNextTokenTestCase to functions
tests/test_numbers_parsing.py New file containing number parsing tests extracted from test_numbers.py
tests/test_numbers_format_decimal.py New file containing decimal formatting tests extracted from test_numbers.py
tests/test_numbers.py Removed FormatDecimalTestCase and NumberParsingTestCase, kept only top-level test functions
tests/test_localedata.py Converted MergeResolveTestCase to standalone test functions
tests/test_dates.py Minor formatting adjustment (added blank line)
tests/messages/utils.py Added Distribution class moved from test_frontend.py
tests/messages/test_pofile_write.py New file containing write tests extracted from test_pofile.py
tests/messages/test_pofile_read.py New file containing read tests extracted from test_pofile.py
tests/messages/test_pofile.py Removed ReadPoTestCase and WritePoTestCase, kept utility test functions
tests/messages/test_mofile.py Converted ReadMoTestCase and WriteMoTestCase to standalone functions with fixture
tests/messages/test_extract_python.py New file containing Python extraction tests extracted from test_extract.py
tests/messages/test_extract.py Removed ExtractPythonTestCase, kept ExtractTestCase tests as functions
tests/messages/test_checkers.py Converted CheckersTestCase and TestPythonFormat to standalone test functions
tests/messages/test_catalog.py Converted MessageTestCase and CatalogTestCase to standalone test functions
tests/messages/frontend/test_init.py New file containing InitCatalog tests from test_frontend.py
tests/messages/frontend/test_extract.py New file containing ExtractMessages tests from test_frontend.py
tests/messages/frontend/test_frontend.py New file containing general frontend tests from test_frontend.py

The refactoring is well-executed and follows pytest conventions. The tests maintain their original behavior while adopting a more modern and idiomatic pytest style.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@akx akx force-pushed the unwrap-testcases branch from c06b041 to 802382f Compare December 25, 2025 16:05
@akx akx changed the title Unwrap testcases Convert Pytest testcases with setup/teardown to fixtures Dec 25, 2025
@akx akx changed the title Convert Pytest testcases with setup/teardown to fixtures Convert Unittest testcases with setup/teardown to fixtures Dec 25, 2025
@akx akx force-pushed the unwrap-testcases branch from 802382f to b3fcb5b Compare December 25, 2025 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants