gentoo/dev-python/python-language-server/files/pyls-fix-test_folding.patch
Andrew Ammerlaan 6a52187a41
dev-python/python-language-server: fix py3.9, allow jedi-0.18
Signed-off-by: Andrew Ammerlaan <andrewammerlaan@riseup.net>
Closes: https://github.com/gentoo/gentoo/pull/20284
Signed-off-by: Matt Turner <mattst88@gentoo.org>
2021-04-06 17:40:24 -04:00

39 lines
1.2 KiB
Diff

From 2d3c52c7b9debd73073650d22a3aa6e86d5491aa Mon Sep 17 00:00:00 2001
From: Ben Greiner <code@bnavigator.de>
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