Skip to content

Commit 9452ebd

Browse files
committed
Adjust expected errors in tests
1 parent 060b01d commit 9452ebd

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

tests/performance/__init__.py

Whitespace-only changes.

tests/stub/test_routingdriver.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,11 @@
3434
)
3535
from neo4j.exceptions import (
3636
ServiceUnavailable,
37-
ClientError,
3837
TransientError,
3938
SessionExpired,
4039
ConfigurationError,
4140
)
4241
from neo4j._exceptions import (
43-
BoltRoutingError,
4442
BoltSecurityError,
4543
)
4644
from tests.stub.conftest import StubCluster
@@ -214,7 +212,7 @@ def test_cannot_discover_servers_on_non_router(driver_info, test_script):
214212
def test_cannot_discover_servers_on_silent_router(driver_info, test_script):
215213
# python -m pytest tests/stub/test_routingdriver.py -s -v -k test_cannot_discover_servers_on_silent_router
216214
with StubCluster(test_script):
217-
with pytest.raises(BoltRoutingError):
215+
with pytest.raises(ServiceUnavailable, match="routing"):
218216
with GraphDatabase.driver(driver_info["uri_neo4j"], auth=driver_info["auth_token"]) as driver:
219217
assert isinstance(driver, Neo4jDriver)
220218
driver._pool.update_routing_table(database=None, bookmarks=None)
@@ -532,7 +530,7 @@ def test_should_serve_read_when_missing_writer(driver_info, test_scripts, test_r
532530
def test_should_error_when_missing_reader(driver_info, test_script):
533531
# python -m pytest tests/stub/test_routingdriver.py -s -v -k test_should_error_when_missing_reader
534532
with StubCluster(test_script):
535-
with pytest.raises(BoltRoutingError):
533+
with pytest.raises(ServiceUnavailable, match="routing"):
536534
with GraphDatabase.driver(driver_info["uri_neo4j"], auth=driver_info["auth_token"]) as driver:
537535
assert isinstance(driver, Neo4jDriver)
538536
driver._pool.update_routing_table(database=None, bookmarks=None)

0 commit comments

Comments
 (0)