From 2d3c52c7b9debd73073650d22a3aa6e86d5491aa Mon Sep 17 00:00:00 2001 From: Ben Greiner Date: Thu, 1 Apr 2021 21:33:38 +0200 Subject: [PATCH 2/2] TST: accept folding of decorator parameters in Python 3.9 --- test/plugins/test_folding.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/test/plugins/test_folding.py b/test/plugins/test_folding.py index 05f0cdd8..91ac0f3b 100644 --- a/test/plugins/test_folding.py +++ b/test/plugins/test_folding.py @@ -1,11 +1,11 @@ # Copyright 2019 Palantir Technologies, Inc. +import sys from textwrap import dedent from pyls import uris -from pyls.workspace import Document from pyls.plugins.folding import pyls_folding_range - +from pyls.workspace import Document DOC_URI = uris.from_fs_path(__file__) DOC = dedent(""" @@ -146,6 +146,10 @@ def test_folding(workspace): {'startLine': 62, 'endLine': 63}, {'startLine': 64, 'endLine': 65}, {'startLine': 67, 'endLine': 68}] + if sys.version_info[:2] >= (3, 9): + # the argument list of the decorator is also folded in Python >= 3.9 + expected.insert(4, {'startLine': 9, 'endLine': 10}) + assert ranges == expected