From 8abbd1cb193d699ec40786363ea499e4ee471753 Mon Sep 17 00:00:00 2001 From: Julian Berman Date: Wed, 17 Aug 2022 14:51:12 +0300 Subject: Better error message for network access in test runs. --- jsonschema/tests/_suite.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'jsonschema') diff --git a/jsonschema/tests/_suite.py b/jsonschema/tests/_suite.py index 0dcc741..a2148ba 100644 --- a/jsonschema/tests/_suite.py +++ b/jsonschema/tests/_suite.py @@ -209,8 +209,8 @@ class _Test(object): # XXX: #693 asks to improve the public API for this, since yeah, it's # bad. Figures that since it's hard for end-users, we experience # the pain internally here too. - def prevent_network_access(*args, **kwargs): - raise RuntimeError("Tried to access the network!") + def prevent_network_access(uri): + raise RuntimeError(f"Tried to access the network: {uri}") resolver.resolve_remote = prevent_network_access validator = Validator(schema=self.schema, resolver=resolver, **kwargs) -- cgit v1.2.1