Skip to content

Commit 5b6b26e

Browse files
committed
Fix the test
1 parent b1e3447 commit 5b6b26e

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

test/plugins/test_yapf_format.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
from pylsp import uris
55
from pylsp.plugins.yapf_format import pylsp_format_document, pylsp_format_range
6-
from pylsp.workspace import Document
6+
from pylsp.workspace import Document, apply_text_edits
77

88
DOC_URI = uris.from_fs_path(__file__)
99
DOC = """A = [
@@ -25,7 +25,7 @@ def test_format(workspace):
2525
doc = Document(DOC_URI, workspace, DOC)
2626
res = pylsp_format_document(doc)
2727

28-
assert doc.apply_text_edits(res) == "A = ['h', 'w', 'a']\n\nB = ['h', 'w']\n"
28+
assert apply_text_edits(res) == "A = ['h', 'w', 'a']\n\nB = ['h', 'w']\n"
2929

3030

3131
def test_range_format(workspace):
@@ -38,7 +38,7 @@ def test_range_format(workspace):
3838
res = pylsp_format_range(doc, def_range)
3939

4040
# Make sure B is still badly formatted
41-
assert doc.apply_text_edits(res) == "A = ['h', 'w', 'a']\n\nB = ['h',\n\n\n'w']\n"
41+
assert apply_text_edits(res) == "A = ['h', 'w', 'a']\n\nB = ['h',\n\n\n'w']\n"
4242

4343

4444
def test_no_change(workspace):
@@ -56,10 +56,10 @@ def test_config_file(tmpdir, workspace):
5656
res = pylsp_format_document(doc)
5757

5858
# A was split on multiple lines because of column_limit from config file
59-
assert doc.apply_text_edits(res) == "A = [\n 'h', 'w',\n 'a'\n]\n\nB = ['h', 'w']\n"
59+
assert apply_text_edits(res) == "A = [\n 'h', 'w',\n 'a'\n]\n\nB = ['h', 'w']\n"
6060

6161
def test_cr_line_endings(workspace):
6262
doc = Document(DOC_URI, workspace, 'import os;import sys\r\rdict(a=1)')
6363
res = pylsp_format_document(doc)
6464

65-
assert doc.apply_text_edits(res) == 'import os\rimport sys\r\rdict(a=1)\r'
65+
assert apply_text_edits(res) == 'import os\rimport sys\r\rdict(a=1)\r'

0 commit comments

Comments
 (0)