This commit is contained in:
@@ -18,6 +18,7 @@ class FakeAdjustable(Adjustable):
|
||||
def __str__(self):
|
||||
return self.name
|
||||
|
||||
# Patched version of snapshot that takes direct adjustable list input to avoid registry.instances patching issues
|
||||
def snapshot_testable(adjustables, include_internal=False, sort_key=str):
|
||||
visible = [a for a in adjustables if include_internal or not a.internal]
|
||||
return sorted(visible, key=sort_key)
|
||||
@@ -98,11 +99,6 @@ def test_snapshot(test_input, expected, kwargs):
|
||||
assert result == []
|
||||
elif 'sort_key' in kwargs:
|
||||
obtained = [x.name for x in result]
|
||||
assert obtained == expected, (
|
||||
f"Erreur de tri.\n"
|
||||
f"Obtenu: {obtained}\n"
|
||||
f"Attendu: {expected}\n"
|
||||
f"Clé de tri: {kwargs['sort_key'].__name__ if callable(kwargs['sort_key']) else kwargs['sort_key']}"
|
||||
)
|
||||
assert obtained == expected
|
||||
else:
|
||||
assert {x.name for x in result} == set(expected)
|
||||
Reference in New Issue
Block a user