Skip to content

test: set locale for test_install_packages_error - #595

Merged
bdrung merged 1 commit into
canonical:mainfrom
bdrung:set-locale
Aug 18, 2026
Merged

test: set locale for test_install_packages_error#595
bdrung merged 1 commit into
canonical:mainfrom
bdrung:set-locale

Conversation

@bdrung

@bdrung bdrung commented Apr 22, 2026

Copy link
Copy Markdown
Member

The test test_install_packages_error will fail on systems where the locale is not set to C (english):

$ python3 -m pytest tests/integration/test_ui_gtk.py tests/system/test_packaging_apt_dpkg.py::test_install_packages_error
[...]
>       exc_info.match("E:Type 'bogus' is not known .* sources could not be read.$")
E       AssertionError: Regex pattern did not match.
E         Expected regex: "E:Type 'bogus' is not known .* sources could not be read.$"
E         Actual message: 'E:Typ »bogus« in Zeile 1 der Quellliste /tmp/tmp4erzi0jq/cache/Foonux 22.04/apt/etc/apt/sources.list ist unbekannt., E:Die Liste der Quellen konnte nicht gelesen werden.'

Set the locale explicitly for this test.

@codecov

codecov Bot commented Apr 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.48%. Comparing base (522aaca) to head (7ce5916).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #595   +/-   ##
=======================================
  Coverage   84.48%   84.48%           
=======================================
  Files         106      106           
  Lines       21034    21044   +10     
  Branches     3189     3192    +3     
=======================================
+ Hits        17770    17780   +10     
  Misses       2790     2790           
  Partials      474      474           

☔ View full report in Codecov by Harness.
📢 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.

@bdrung
bdrung force-pushed the set-locale branch 2 times, most recently from a3e5670 to d64b167 Compare April 22, 2026 21:59
@bdrung
bdrung requested a review from Hyask July 3, 2026 15:10
@bdrung bdrung added the bug Something isn't working label Aug 18, 2026

@Hyask Hyask left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Good idea!

The test `test_install_packages_error` will fail on systems where the locale is
not set to C (english):

```
$ python3 -m pytest tests/integration/test_ui_gtk.py tests/system/test_packaging_apt_dpkg.py::test_install_packages_error
[...]
>       exc_info.match("E:Type 'bogus' is not known .* sources could not be read.$")
E       AssertionError: Regex pattern did not match.
E         Expected regex: "E:Type 'bogus' is not known .* sources could not be read.$"
E         Actual message: 'E:Typ »bogus« in Zeile 1 der Quellliste /tmp/tmp4erzi0jq/cache/Foonux 22.04/apt/etc/apt/sources.list ist unbekannt., E:Die Liste der Quellen konnte nicht gelesen werden.'
```

Set the locale explicitly for this test.
@bdrung
bdrung merged commit 7ce5916 into canonical:main Aug 18, 2026
28 checks passed
@bdrung
bdrung deleted the set-locale branch August 18, 2026 16:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants