added --empty-object-with-newline formatting and checking

This commit is contained in:
Andreas Scheucher 2023-08-13 20:17:52 +02:00
commit 39f95ccaea
2 changed files with 5 additions and 7 deletions

View file

@ -1,10 +1,10 @@
from __future__ import annotations
import filecmp
import os
import shutil
import pytest
import filecmp
from pre_commit_hooks.pretty_format_json import main
from pre_commit_hooks.pretty_format_json import parse_num_to_int
@ -142,8 +142,8 @@ def test_diffing_output(capsys):
def test_empty_object_with_newline(tmpdir):
# same line objects shoud trigger with --empty-object-with-newline switch
sameline = get_resource_path("empty_object_json_sameline.json")
ret = main(["--empty-object-with-newline", str(sameline)])
sameline = get_resource_path('empty_object_json_sameline.json')
ret = main(['--empty-object-with-newline', str(sameline)])
assert ret == 1
# a template to be compared against.