Skip to content

Commit

Permalink
Refactored some tests utils
Browse files Browse the repository at this point in the history
  • Loading branch information
alexpro2022 committed Dec 9, 2023
1 parent 68da444 commit 8b4197a
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ def get_method(instance: Any, method_name: str):

def compare(left, right) -> None:
def clean(item) -> dict:
wanted = '_sa_instance_state'
d = vars(item).copy()
try:
d.pop('_sa_instance_state')
except KeyError:
pass
if hasattr(d, wanted):
d.pop(wanted)
return d

assert clean(left) == clean(right)
# diff = DeepDiff(clean(left), clean(right), ignore_order=True)
# assert not diff, diff
Expand All @@ -42,10 +42,3 @@ def check_exception_info(exc_info, expected_msg: str, expected_error_code: int |

def check_exception_info_not_found(exc_info, msg_not_found: str) -> None:
check_exception_info(exc_info, msg_not_found, status.HTTP_404_NOT_FOUND)


def info(*args, stop: bool = True):
for arg in args:
print(f'\n{arg}')
if stop:
assert 0

0 comments on commit 8b4197a

Please sign in to comment.