From 9adb0c6658019a1a11a7f55fc7bfeab9c132e289 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Robert?= Date: Mon, 13 Sep 2021 21:11:18 +0200 Subject: [PATCH] BUG: fix broken tests for versioned_branches feature --- tests/features/versioned_branches_test.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/features/versioned_branches_test.py b/tests/features/versioned_branches_test.py index 3c865591..fa240aeb 100644 --- a/tests/features/versioned_branches_test.py +++ b/tests/features/versioned_branches_test.py @@ -545,6 +545,15 @@ def test_fix_py3_only_code(s, expected): '3+6\n', id='from sys import version_info, <= (3, 5)', ), + pytest.param( + 'import sys\n' + 'if sys.version_info >= (3, 6):\n' + ' pass', + + 'import sys\n' + 'pass', + id='sys.version_info >= (3, 6), noelse', + ), ), ) def test_fix_py3x_only_code(s, expected): @@ -555,15 +564,6 @@ def test_fix_py3x_only_code(s, expected): @pytest.mark.parametrize( 's', ( - # we timidly skip `if` without `else` as it could cause a SyntaxError - 'import sys' - 'if sys.version_info >= (3, 6):\n' - ' pass', - # here's the case where it causes a SyntaxError - 'import sys' - 'if True' - ' if sys.version_info >= (3, 6):\n' - ' pass\n', # both branches are still relevant in the following cases 'import sys\n' 'if sys.version_info > (3, 7):\n'