Files
beets/docs
Šarūnas Nejus e16144e298 importer: skip TestImport7z and TestImportRar when optional dependencies are missing (#7004)
## Description

Fixes #7002.

Both `py7zr` and `rarfile` are optional dependencies specified under the
`import` extra (`beets[import]`).
When running the test suite in environments where `py7zr` is not
installed (e.g. minimal packaging buildroots such as Fedora Rawhide),
`ArchiveImportTask.handlers` does not register the 7z extraction
handler. Consequently, `TestImport7z` runs unconditionally and treats
`archive.7z` as an ordinary file rather than an archive, failing with:
```text
FAILED test/test_importer.py::TestImport7z::test_import_zip
E       assert 0 == 1
E        +  where 0 = len(<beets.dbcore.db.Results object>)
E        +    where <beets.dbcore.db.Results object> = items()
WARNING beets:stages.py:58 No files imported from .../test/rsrc/archive.7z
```

Additionally, `TestImportRar` previously checked only for the presence
of the `unrar` executable via `has_program("unrar")`, but extraction
also depends on the Python `rarfile` package being importable.

This PR:
1. Adds `NEEDS_PY7ZR` (`is_importable("py7zr")`) and `NEEDS_RARFILE`
(`is_importable("rarfile") and has_program("unrar")`) test skip markers
in `beets.test.helper`.
2. Marks `TestImport7z` with `@NEEDS_PY7ZR`.
3. Marks `TestImportRar` with `@NEEDS_RARFILE`.
4. Adds an unreleased bug fix entry to `docs/changelog.rst`.

## To Do

- [x] ~Documentation.~
- [x] Changelog.
- [x] Tests.
2026-09-12 09:51:48 +00:00
..
2026-08-18 10:46:33 +01:00
2026-05-20 16:53:06 +02:00
2025-09-04 12:49:44 +01:00
2026-09-07 20:23:30 +00:00
2025-09-04 12:49:44 +01:00
2026-06-30 12:44:21 +01:00
2017-12-21 11:39:08 -05:00
2026-03-02 08:31:44 +01:00