5
5
from pathlib import Path
6
6
7
7
import pytest
8
- from rope .base .exceptions import BadIdentifierError
9
8
10
9
from pylsp import uris
11
10
from pylsp .config .config import Config
@@ -74,7 +73,7 @@ def test_implementations_skipping_one_class(config, workspace, doc_uri) -> None:
74
73
75
74
76
75
@pytest .mark .xfail (
77
- reason = "not implemented upstream (Rope)" , strict = True , raises = BadIdentifierError
76
+ reason = "not implemented upstream (Rope)" , strict = True , raises = AssertionError
78
77
)
79
78
def test_property_implementations (config , workspace , doc_uri ) -> None :
80
79
# Over 'Animal.size'
@@ -93,12 +92,11 @@ def test_property_implementations(config, workspace, doc_uri) -> None:
93
92
94
93
95
94
def test_implementations_not_a_method (config , workspace , doc_uri ) -> None :
96
- # Over 'print(...)' call => Rope error because not a method.
95
+ # Over 'print(...)' call
97
96
cursor_pos = {"line" : 28 , "character" : 0 }
98
97
99
98
doc = workspace .get_document (doc_uri )
100
99
101
- # This exception is turned into an empty result set automatically in upper
102
- # layers, so we just check that it is raised to document this behavior:
103
- with pytest .raises (BadIdentifierError ):
104
- pylsp_implementations (config , workspace , doc , cursor_pos )
100
+ # Rope produces an error because we're not over a method, which we then
101
+ # turn into an empty result list:
102
+ assert [] == pylsp_implementations (config , workspace , doc , cursor_pos )
0 commit comments