]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
tests/python: remove __init__.py docs-tests-python-sd9hmg/deployments/9772 1884/head
authorAleš Mrázek <ales.mrazek@nic.cz>
Wed, 5 Aug 2026 22:33:49 +0000 (00:33 +0200)
committerAleš Mrázek <ales.mrazek@nic.cz>
Wed, 5 Aug 2026 22:33:49 +0000 (00:33 +0200)
Moved global validation context to individual modules.

tests/python/knot_resolver/__init__.py [deleted file]
tests/python/knot_resolver/datamodel/test_config_schema.py
tests/python/knot_resolver/datamodel/types/test_custom_types.py
tests/python/knot_resolver/test_config_store.py

diff --git a/tests/python/knot_resolver/__init__.py b/tests/python/knot_resolver/__init__.py
deleted file mode 100644 (file)
index 5b82d3b..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-from pathlib import Path
-
-from knot_resolver.datamodel.globals import Context, set_global_validation_context
-
-set_global_validation_context(Context(Path("."), False))
index 6d55da378c2e87799e964512655a6b0f2bb51a1f..79488e5c07e0f4baebd94c6389e1abeae0d26e79 100644 (file)
@@ -1,8 +1,10 @@
 import inspect
 import json
+from pathlib import Path
 from typing import Any, Dict, Type, cast
 
 from knot_resolver.datamodel import KresConfig
+from knot_resolver.datamodel.globals import Context, set_global_validation_context
 from knot_resolver.datamodel.lua_schema import LuaSchema
 from knot_resolver.utils.modeling import BaseSchema
 from knot_resolver.utils.modeling.types import (
@@ -16,6 +18,8 @@ from knot_resolver.utils.modeling.types import (
     is_union,
 )
 
+set_global_validation_context(Context(Path("."), False))
+
 
 def test_config_check_str_type():
     # check that there is no 'str' type in datamodel schema (except for LuaSchema
index c3c3ff5baecca7689f77c5c4a02a271cea7524cb..9ad45f68c90deb8f323987f031f2d12ba59f2dc1 100644 (file)
@@ -1,11 +1,13 @@
 import ipaddress
 import random
 import string
+from pathlib import Path
 from typing import Any
 
 import pytest
 from pytest import raises
 
+from knot_resolver.datamodel.globals import Context, set_global_validation_context
 from knot_resolver.datamodel.types import (
     Dir,
     DomainName,
@@ -27,6 +29,8 @@ from knot_resolver.datamodel.types import (
 )
 from knot_resolver.utils.modeling import BaseSchema
 
+set_global_validation_context(Context(Path("."), False))
+
 
 def _rand_domain(label_chars: int, levels: int = 1) -> str:
     return "".join(
index c12fe54be41694966695f574b82e37a576062c7c..10b15e577db45f69db92198d3920d7ee0cb1453b 100644 (file)
@@ -1,8 +1,13 @@
+from pathlib import Path
+
 import pytest
 
 from knot_resolver.datamodel.config_schema import KresConfig
+from knot_resolver.datamodel.globals import Context, set_global_validation_context
 from knot_resolver.manager.config_store import ConfigStore, only_on_real_changes_update
 
+set_global_validation_context(Context(Path("."), False))
+
 
 @pytest.mark.asyncio  # type: ignore
 async def test_only_once():