27 Commits

Author SHA1 Message Date
Šarūnas Nejus
30ab81eb5b Extract UserError from beets.ui to a new beets.exceptions module.
Update all references in core, plugins, and tests to import UserError
from the new location. This centralizes exception handling and improves
code organization.
2026-05-16 11:18:51 +01:00
Šarūnas Nejus
ccdccdfa8d Remove slow_test unittest marker 2026-04-22 21:47:16 +01:00
Sebastian Mohr
be057e8bbf Fixed tests 2026-04-22 22:20:01 +02:00
Šarūnas Nejus
a2cb160064 Store item paths relative to library directory
Convert item paths to relative on write and back to absolute on read,
keeping the database free of hardcoded library directory. Fix tests to
account for absolute path return values.
2026-04-11 13:01:41 +01:00
Šarūnas Nejus
02be9b277d Handle legacy fields in modify and queries 2026-04-07 10:42:56 +01:00
Šarūnas Nejus
b8def07121 autotag: use explicit imports 2026-03-28 12:26:27 +00:00
Šarūnas Nejus
2a003ac709 Refactor ShowChangeTest to use snapshot-style assertions
Replace multiple small tests with two comprehensive snapshot tests
covering the same edge cases and newline and column layouts.

Use BeetsTestCase to ensure that the local dev config is ignored.
2026-03-17 17:59:51 +00:00
Šarūnas Nejus
286bce13c9 Fix show_model_changes 2026-03-16 07:38:21 +00:00
Šarūnas Nejus
6a93bf54af Move layout utils to beets/util/layout.py 2026-03-14 12:02:30 +00:00
Šarūnas Nejus
fc39ab791c Create a dedicated get_model_changes function in beets/util/diff.py
- Add `get_model_changes` as the public API for computing diffs
- Remove tests for `show_model_changes` as test_diff.py fully covers them.
2026-03-14 12:02:30 +00:00
Šarūnas Nejus
756d5c9921 Move diff utils to beets/util/diff.py 2026-03-14 11:58:04 +00:00
Šarūnas Nejus
a6fcb7ba0f Fix references to color utils 2026-03-14 11:57:18 +00:00
Šarūnas Nejus
aa52aaca56 Move colorisation to beets/util/color.py 2026-03-14 11:57:18 +00:00
Šarūnas Nejus
a8d53f78de Fix the rest of the tests 2026-02-27 18:34:26 +00:00
Šarūnas Nejus
4699958f25 Remove redundant coloring logic 2026-02-22 16:13:21 +00:00
Šarūnas Nejus
31f79f14a3 Colorize multi-valued field changes distinctly 2026-02-22 16:13:20 +00:00
Šarūnas Nejus
d613981efe Replace capture_output with io.getoutput 2026-02-10 00:53:20 +00:00
Šarūnas Nejus
fea789bb59 Replace control_stdin with io.addinput 2026-02-10 00:53:20 +00:00
Šarūnas Nejus
6a65f13776 Replace custom stdio mocks with pytest io fixture
Create a centralised pytest fixture to provide controllable stdin and
captured stdout in all tests. Simplify DummyIO/DummyIn and remove the
custom DummyOut implementation and make use of pytest builtin fixtures.

Create a centralised pytest fixture to provide controllable stdin and
captured stdout that can be applied to any tests, regardless whether
they are based on pytest or unittest.

* `io` fixture can be used as a fixture in pytest-based tests
* `IOMixin` can be used to attach `io` attribute to any test class,
  including `unittest.TestCase`
2026-02-10 00:53:20 +00:00
Šarūnas Nejus
1c87da2c05 Fix test failures 2026-02-10 00:53:20 +00:00
Šarūnas Nejus
a4249af700 Patch sys.stdin and sys.stdout in tests 2026-02-10 00:53:20 +00:00
Šarūnas Nejus
c52656fb0a Enable RUF rules 2026-01-13 20:55:40 +00:00
Šarūnas Nejus
c807effeda Define a shared fixture for config 2025-12-27 14:30:35 +00:00
Šarūnas Nejus
75baec611a Improve and simplify show_model_changes 2025-12-27 14:30:35 +00:00
Šarūnas Nejus
ea157832fe hooks: make AlbumMatch.mapping a tuple 2025-12-24 11:01:26 +00:00
Emi Katagiri-Simpson
86a74970f9 Merge remote-tracking branch 'upstream/master' into HEAD 2025-11-06 20:11:57 -05:00
Sebastian Mohr
a59e41a883 tests: move command tests into dedicated files
Moved tests related to ui into own folder.
Moved 'modify' command tests into own file.
Moved 'write' command tests into own file.
Moved 'fields' command tests into own file.
Moved 'do_query' test into own file.
Moved 'list' command tests into own file.
Moved 'remove' command tests into own file.
Moved 'move' command tests into own file.
Moved 'update' command tests into own file.
Moved 'show_change' test into test_import file.
Moved 'summarize_items' test into test_import file.
Moved 'completion' command test into own file.
2025-11-03 14:00:58 +01:00