Skip to content

Commit

Permalink
final update
Browse files Browse the repository at this point in the history
  • Loading branch information
имя фамилия committed Jul 10, 2023
1 parent a4c644b commit a2dcf1c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
13 changes: 7 additions & 6 deletions gendiff/formats/plain.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
def get_formatted_value(value):
elem_types = {"<class 'NoneType'>": 'null',
"<class 'bool'>": str(value).lower(),
"<class 'str'>": f'\'{value}\'',
"<class 'int'>": value,
"<class 'dict'>": '[complex value]'}
type_value = str(type(value))
elem_types = {type(None): 'null',
type(bool): str(value).lower(),
type(''): f'\'{value}\'',
type(0): value,
type({}): '[complex value]'}

type_value = type(value)
if type_value in elem_types:
return elem_types[type_value]
return value
Expand Down
1 change: 0 additions & 1 deletion tests/test_recursion_comparison.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from gendiff import generate_diff
import pytest
LAST_ELEM = -1


@pytest.mark.parametrize('path1, path2, formatter, expected', [
Expand Down

0 comments on commit a2dcf1c

Please sign in to comment.