@@ -49,20 +49,28 @@ def get_hover_text(result):
4949 return contents
5050
5151 contents = "NumPy\n =====\n \n Provides\n "
52- assert contents in get_hover_text (pylsp_hover (doc ._config , doc , numpy_hov_position_1 ))
52+ assert contents in get_hover_text (
53+ pylsp_hover (doc ._config , doc , numpy_hov_position_1 )
54+ )
5355
5456 contents = "NumPy\n =====\n \n Provides\n "
55- assert contents in get_hover_text (pylsp_hover (doc ._config , doc , numpy_hov_position_2 ))
57+ assert contents in get_hover_text (
58+ pylsp_hover (doc ._config , doc , numpy_hov_position_2 )
59+ )
5660
5761 contents = "NumPy\n =====\n \n Provides\n "
58- assert contents in get_hover_text (pylsp_hover (doc ._config , doc , numpy_hov_position_3 ))
62+ assert contents in get_hover_text (
63+ pylsp_hover (doc ._config , doc , numpy_hov_position_3 )
64+ )
5965
6066 # https://github.com/davidhalter/jedi/issues/1746
6167 import numpy as np
6268
6369 if np .lib .NumpyVersion (np .__version__ ) < "1.20.0" :
6470 contents = "Trigonometric sine, element-wise.\n \n "
65- assert contents in get_hover_text (pylsp_hover (doc ._config , doc , numpy_sin_hov_position ))
71+ assert contents in get_hover_text (
72+ pylsp_hover (doc ._config , doc , numpy_sin_hov_position )
73+ )
6674
6775
6876def test_hover (workspace ) -> None :
@@ -78,7 +86,10 @@ def test_hover(workspace) -> None:
7886 assert isinstance (result ["contents" ], list )
7987 assert len (result ["contents" ]) == 2
8088 # First item is the signature code block
81- assert result ["contents" ][0 ] == {"language" : "python" , "value" : "main(a: float, b: float)" }
89+ assert result ["contents" ][0 ] == {
90+ "language" : "python" ,
91+ "value" : "main(a: float, b: float)" ,
92+ }
8293 # Second item is the docstring
8394 assert "hello world" in result ["contents" ][1 ]
8495
@@ -99,7 +110,10 @@ def test_hover_signature_formatting(workspace) -> None:
99110 assert len (result ["contents" ]) == 2
100111 # Due to changes in our fork, hover no longer applies signature formatting
101112 # It just returns the raw signature from Jedi
102- assert result ["contents" ][0 ] == {"language" : "python" , "value" : "main(a: float, b: float)" }
113+ assert result ["contents" ][0 ] == {
114+ "language" : "python" ,
115+ "value" : "main(a: float, b: float)" ,
116+ }
103117 # Second item is the docstring
104118 assert "hello world" in result ["contents" ][1 ]
105119
@@ -116,7 +130,10 @@ def test_hover_signature_formatting_opt_out(workspace) -> None:
116130 assert isinstance (result ["contents" ], list )
117131 assert len (result ["contents" ]) == 2
118132 # First item is the signature code block without multiline formatting
119- assert result ["contents" ][0 ] == {"language" : "python" , "value" : "main(a: float, b: float)" }
133+ assert result ["contents" ][0 ] == {
134+ "language" : "python" ,
135+ "value" : "main(a: float, b: float)" ,
136+ }
120137 # Second item is the docstring
121138 assert "hello world" in result ["contents" ][1 ]
122139
@@ -148,7 +165,10 @@ def foo():
148165 # The result should be either a list with signature and/or docstring, or empty string
149166 if isinstance (contents , list ) and len (contents ) > 0 :
150167 # Convert list to string for checking
151- contents_str = ' ' .join (str (item ) if not isinstance (item , dict ) else item .get ('value' , '' ) for item in contents )
168+ contents_str = " " .join (
169+ str (item ) if not isinstance (item , dict ) else item .get ("value" , "" )
170+ for item in contents
171+ )
152172 assert "A docstring for foo." in contents_str
153173 else :
154174 # If Jedi can't resolve the definition (e.g., in test environment), the hover may be empty
0 commit comments