Skip to content
Snippets Groups Projects
Commit 4e061b4f authored by Henrik tom Wörden's avatar Henrik tom Wörden
Browse files

FIX: style and lint errors

parent a7958e4a
No related branches found
No related tags found
2 merge requests!159Release 0.16.o,!155Review filter lists and compare_entities
Pipeline #57182 passed with warnings
...@@ -327,7 +327,7 @@ def compare_entities(old_entity: Entity, new_entity: Entity, ...@@ -327,7 +327,7 @@ def compare_entities(old_entity: Entity, new_entity: Entity,
try: try:
same = empty_diff(val0, val1, False, same = empty_diff(val0, val1, False,
entity_name_id_equivalency) entity_name_id_equivalency)
except: except (ValueError, NotImplementedError):
same = False same = False
if same: if same:
continue continue
......
...@@ -116,7 +116,7 @@ All additional arguments are at their default values. ...@@ -116,7 +116,7 @@ All additional arguments are at their default values.
return result return result
@ lru_cache(maxsize=DEFAULT_SIZE) @lru_cache(maxsize=DEFAULT_SIZE)
def _cached_access(kind: AccessType, value: Union[str, int], unique: bool = True): def _cached_access(kind: AccessType, value: Union[str, int], unique: bool = True):
# This is the function that is actually cached. # This is the function that is actually cached.
# Due to the arguments, the cache has kind of separate sections for cached_query and # Due to the arguments, the cache has kind of separate sections for cached_query and
......
...@@ -343,14 +343,8 @@ def test_compare_entities_battery(): ...@@ -343,14 +343,8 @@ def test_compare_entities_battery():
# Order invariance # Order invariance
t7 = db.Property(**prop_settings).add_parent(par1).add_property(prop1) t7 = db.Property(**prop_settings).add_parent(par1).add_property(prop1)
t8 = db.Property(**alt_settings).add_parent(par3).add_property(prop3) t8 = db.Property(**alt_settings).add_parent(par3).add_property(prop3)
try: diffs_0 = compare_entities(t7, t8), compare_entities(t7, t8, True)
diffs_0 = compare_entities(t7, t8), compare_entities(t7, t8, True) diffs_1 = compare_entities(t8, t7)[::-1], compare_entities(t8, t7, True)[::-1]
except:
diffs_0 = None
try:
diffs_1 = compare_entities(t8, t7)[::-1], compare_entities(t8, t7, True)[::-1]
except:
diffs_1 = None
assert diffs_0 == diffs_1 assert diffs_0 == diffs_1
prop_settings = {"datatype": db.REFERENCE, "description": "desc of prop", prop_settings = {"datatype": db.REFERENCE, "description": "desc of prop",
"value": db.Record().add_parent(par3), "unit": '°'} "value": db.Record().add_parent(par3), "unit": '°'}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment