Skip to content

fix: resolve test errors and deprecation warnings#731

Open
slowsage wants to merge 1 commit intosharkwouter:masterfrom
slowsage:fix/errors_and_warnings
Open

fix: resolve test errors and deprecation warnings#731
slowsage wants to merge 1 commit intosharkwouter:masterfrom
slowsage:fix/errors_and_warnings

Conversation

@slowsage
Copy link
Copy Markdown
Contributor

@slowsage slowsage commented Feb 19, 2026

Description

Installing minigalaxy-git on arch fails (paru -S minigalaxy-git) with errors and warnings:

__________________________________________ ERROR collecting tests/test_ui_library.py __________________________________________
ImportError while importing test module '/home/sridhar/.cache/paru/clone/minigalaxy-git/src/minigalaxy/tests/test_ui_library.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib/python3.14/importlib/__init__.py:88: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
tests/test_ui_library.py:9: in <module>
    from MockGiRepository import MockGiRepository
E   ModuleNotFoundError: No module named 'MockGiRepository'
__________________________________________ ERROR collecting tests/test_ui_window.py ___________________________________________
ImportError while importing test module '/home/sridhar/.cache/paru/clone/minigalaxy-git/src/minigalaxy/tests/test_ui_window.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/lib/python3.14/importlib/__init__.py:88: in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
tests/test_ui_window.py:6: in <module>
    from MockGiRepository import MockGiRepository
E   ModuleNotFoundError: No module named 'MockGiRepository'
====================================================== warnings summary =======================================================
minigalaxy/api.py:235
  /home/sridhar/.cache/paru/clone/minigalaxy-git/src/minigalaxy/minigalaxy/api.py:235: SyntaxWarning: 'return' in a 'finally' block
    return result

minigalaxy/translation.py:32
  /home/sridhar/.cache/paru/clone/minigalaxy-git/src/minigalaxy/minigalaxy/translation.py:32: DeprecationWarning: 'locale.getdefaultlocale' is deprecated and slated for removal in Python 3.15. Use setlocale(), getencoding() and getlocale() instead.
    default_locale = locale.getdefaultlocale()[0]
  • ERROR: Add pytest pythonpath config for test discovery
  • WARN: Replace deprecated locale.getdefaultlocale() with getlocale()
  • WARN: Use explicit 'is not None' for XML Element check
  • WARN: Move return statement out of finally block

Ran python3 -m pytest -v -W error to ensure no warnings remain.
Note: Not super confident of locale related testing since I only have English.

Checklist

  • CHANGELOG.md was updated (format: - Change made (thanks to github_username))

- ERROR: Add pytest pythonpath config for test discovery
- WARN: Replace deprecated locale.getdefaultlocale() with getlocale()
- WARN: Use explicit 'is not None' for XML Element check
- WARN: Move return statement out of finally block
@GB609
Copy link
Copy Markdown
Collaborator

GB609 commented Feb 20, 2026

Hey. Thanks for the PR and sorry for the delay.
I'm also using ArchLinux, so i would like to test and verify your changes first. I'll come back to you as soon as i can.

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