3636@pytest .mark .parametrize ("host" , ("localhost" , "127.0.0.1" ,
3737 "[::1]" , "[0:0:0:0:0:0:0:1]" ))
3838@pytest .mark .parametrize ("port" , (":1234" , "" , ":7687" ))
39+ @pytest .mark .parametrize ("params" , ("" , "?routing_context=test" ))
3940@pytest .mark .parametrize ("auth_token" , (("test" , "test" ), None ))
40- def test_direct_driver_constructor (protocol , host , port , auth_token ):
41- uri = protocol + host + port
42- driver = AsyncGraphDatabase .driver (uri , auth = auth_token )
41+ @mark_async_test
42+ async def test_direct_driver_constructor (protocol , host , port , params , auth_token ):
43+ uri = protocol + host + port + params
44+ if params :
45+ with pytest .warns (DeprecationWarning , match = "routing context" ):
46+ driver = AsyncGraphDatabase .driver (uri , auth = auth_token )
47+ else :
48+ driver = AsyncGraphDatabase .driver (uri , auth = auth_token )
4349 assert isinstance (driver , AsyncBoltDriver )
50+ await driver .close ()
4451
4552
4653@pytest .mark .parametrize ("protocol" , ("neo4j://" , "neo4j+s://" , "neo4j+ssc://" ))
4754@pytest .mark .parametrize ("host" , ("localhost" , "127.0.0.1" ,
4855 "[::1]" , "[0:0:0:0:0:0:0:1]" ))
4956@pytest .mark .parametrize ("port" , (":1234" , "" , ":7687" ))
57+ @pytest .mark .parametrize ("params" , ("" , "?routing_context=test" ))
5058@pytest .mark .parametrize ("auth_token" , (("test" , "test" ), None ))
51- def test_routing_driver_constructor (protocol , host , port , auth_token ):
52- uri = protocol + host + port
59+ @mark_async_test
60+ async def test_routing_driver_constructor (protocol , host , port , params , auth_token ):
61+ uri = protocol + host + port + params
5362 driver = AsyncGraphDatabase .driver (uri , auth = auth_token )
5463 assert isinstance (driver , AsyncNeo4jDriver )
64+ await driver .close ()
5565
5666
5767@pytest .mark .parametrize ("test_uri" , (
@@ -81,7 +91,8 @@ def test_routing_driver_constructor(protocol, host, port, auth_token):
8191 ),
8292 )
8393)
84- def test_driver_config_error (
94+ @mark_async_test
95+ async def test_driver_config_error (
8596 test_uri , test_config , expected_failure , expected_failure_message
8697):
8798 if "+" in test_uri :
@@ -90,7 +101,8 @@ def test_driver_config_error(
90101 with pytest .raises (expected_failure , match = expected_failure_message ):
91102 AsyncGraphDatabase .driver (test_uri , ** test_config )
92103 else :
93- AsyncGraphDatabase .driver (test_uri , ** test_config )
104+ driver = AsyncGraphDatabase .driver (test_uri , ** test_config )
105+ await driver .close ()
94106
95107
96108@pytest .mark .parametrize ("test_uri" , (
@@ -138,3 +150,5 @@ async def test_driver_opens_write_session_by_default(uri, mocker):
138150 mocker .ANY ,
139151 mocker .ANY
140152 )
153+
154+ await driver .close ()
0 commit comments