Skip to content

test: set locale for test_install_packages_error#595

Open
bdrung wants to merge 1 commit intocanonical:mainfrom
bdrung:set-locale
Open

test: set locale for test_install_packages_error#595
bdrung wants to merge 1 commit intocanonical:mainfrom
bdrung:set-locale

Conversation

@bdrung
Copy link
Copy Markdown
Member

@bdrung bdrung commented Apr 22, 2026

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

codecov Bot commented Apr 22, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.45%. Comparing base (5beb93d) to head (d64b167).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #595   +/-   ##
=======================================
  Coverage   84.45%   84.45%           
=======================================
  Files         104      104           
  Lines       20939    20948    +9     
  Branches     3212     3215    +3     
=======================================
+ Hits        17683    17692    +9     
  Misses       2815     2815           
  Partials      441      441           

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

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

1 participant