File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change 1+ from pathlib import Path
12import pytest
23from unittest .mock import patch
4+ import tomllib
35from socketsecurity .core .socket_config import SocketConfig
46from socketsecurity .config import CliConfig
57
@@ -162,3 +164,16 @@ def test_config_file_json_sets_defaults(self, tmp_path):
162164 assert config .sarif_scope == "full"
163165 assert config .sarif_grouping == "alert"
164166 assert config .sarif_reachability == "reachable"
167+
168+
169+ def test_pyproject_requires_python_matches_tomllib_usage ():
170+ pyproject = tomllib .loads (Path ("pyproject.toml" ).read_text (encoding = "utf-8" ))
171+ requires_python = pyproject ["project" ]["requires-python" ]
172+
173+ assert requires_python .startswith (">=" )
174+
175+ minimum_version = tuple (int (part ) for part in requires_python .removeprefix (">=" ).split ("." )[:2 ])
176+ config_module = Path ("socketsecurity/config.py" ).read_text (encoding = "utf-8" )
177+
178+ if "import tomllib" in config_module :
179+ assert minimum_version >= (3 , 11 )
You can’t perform that action at this time.
0 commit comments