Commit Graph

20 Commits

Author SHA1 Message Date
Valentyn Kit
eb7c832fc9 Make InQuery hashable when its pattern is a list
InQuery inherited FieldQuery.__hash__, which hashes the pattern directly.
A list pattern raises `unhashable type: 'list'`, which broke the
smartplaylist `splupdate` command whenever a `playlist:` query was configured.
2026-07-15 08:02:01 +01:00
TowyTowy
2293d2f60a Fix crash when sorting by a nullable field missing on some items
Sorting by a field whose declared type is nullable (its null value is
`None`, e.g. `NullInteger`/`NullFloat`) raised `TypeError: '<' not
supported between instances of ...` when the field was present on some
objects but missing on others, because `FieldSort.sort` compared `None`
against real values.

Group missing values together in the sort key so they are never compared
against present ones: they are ordered first when sorting ascending and
last when descending, matching SQLite's default ordering of NULLs used by
the fast `FixedFieldSort` path.

Fixes #3461.

Co-Authored-By: Claude <noreply@anthropic.com>
2026-07-13 13:36:23 +01:00
Šarūnas Nejus
230bf19c7f Remove redundant test logic exposed by full coverage
- Removing the coverage omit configuration exposed unused branches, helpers, and
  fixtures across the test suite.
- Delete that redundant logic and simplify affected tests while preserving their
  behavior.
2026-07-07 15:57:35 +01:00
Šarūnas Nejus
79c7d69311 Remove wrongly added copyright markers 2026-07-07 15:57:35 +01:00
Šarūnas Nejus
7cf8896597 Make the global config fixture function-scoped 2026-07-03 21:21:19 +01:00
Šarūnas Nejus
900543baca Move test modules under folders that they belong to 2026-06-30 21:48:40 +01:00
Sebastian Mohr
54a2bd20e1 Removed This file is part of beets... headers. 2026-06-29 11:20:15 +02:00
Šarūnas Nejus
de5c690181 Use class-scoped config across the test module 2026-06-24 17:01:19 +01:00
Šarūnas Nejus
af1e6ceb4d Remove duplicate branches 2026-06-24 17:01:19 +01:00
Šarūnas Nejus
31f7cd4360 Tighten config sort tests
- Combine default and override sort assertions for items and albums.
- Use the config fixture and exact ordered results to avoid global config state.
2026-06-24 17:01:19 +01:00
Šarūnas Nejus
616b1b2b0b Refactor TestNonExistingField
- Consolidate duplicate sort test coverage with parametrized cases.
- Keep missing-field and mixed-presence behavior covered while reducing repeated
  assertions.
2026-06-24 17:01:19 +01:00
Šarūnas Nejus
85e4c607d2 Simplify TestCaseSensitivity 2026-06-24 17:01:19 +01:00
Šarūnas Nejus
fb812daebe Simplify paths 2026-06-24 17:01:19 +01:00
Šarūnas Nejus
eb07fa3a40 Consolidate sort query tests
- Replace duplicate direct MultipleSort checks with parametrized query-string
  cases covering single-field, multi-field, fixed, flex, and computed sort
  behavior.
- Reduce test repetition while keeping the same sort behavior coverage.
2026-06-24 17:01:19 +01:00
Šarūnas Nejus
349b082232 Parametrize descending sort coverage 2026-06-24 17:01:19 +01:00
Šarūnas Nejus
2d98777205 Parametrize ascending sort coverage
- Consolidate duplicate ascending sort tests across item and album fixed and
  flexible fields.
2026-06-24 17:01:19 +01:00
Šarūnas Nejus
da1969125b Only set required fields 2026-06-24 17:01:19 +01:00
Šarūnas Nejus
100a645ffa Use pytest 2026-06-24 17:01:19 +01:00
Šarūnas Nejus
0cd20798aa sort: Update dotted sort references 2026-05-17 07:39:13 +01:00
Šarūnas Nejus
2db5383850 Move test_sort.py under test/dbcore 2026-05-17 07:39:13 +01:00