From 041f406eeed3a5ebba3f872eed587913d603baaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Rogalski?= Date: Mon, 4 Oct 2021 22:55:27 +0200 Subject: [PATCH] Add missing tests for SyntaxError --- src/darker/tests/test_verification.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/darker/tests/test_verification.py b/src/darker/tests/test_verification.py index 96680156a..fe21a2871 100644 --- a/src/darker/tests/test_verification.py +++ b/src/darker/tests/test_verification.py @@ -42,6 +42,9 @@ def test_ast_verifier_is_equivalent(): assert not verifier.is_equivalent_to_baseline( TextDocument.from_lines(["if False: pass"]) ) + assert not verifier.is_equivalent_to_baseline( + TextDocument.from_lines(["if False:"]) + ) def test_ast_verifier_assert_equivalent(): @@ -54,6 +57,8 @@ def test_ast_verifier_assert_equivalent(): verifier.assert_equivalent_to_baseline( TextDocument.from_lines(["if False: pass"]) ) + with pytest.raises(NotEquivalentError): + verifier.assert_equivalent_to_baseline(TextDocument.from_lines(["if False:"])) def test_binary_search_premature_result():