Skip to content

Commit 40a97b2

Browse files
committed
TOML -> JSON, mirroring the suite move.
1 parent 635a287 commit 40a97b2

File tree

2 files changed

+6
-14
lines changed

2 files changed

+6
-14
lines changed

noxfile.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,7 @@ def _session(fn):
2222

2323
@session(python=["3.8", "3.9", "3.10", "3.11", "pypy3"])
2424
def tests(session):
25-
dependencies = [
26-
"pytest",
27-
"tomli; python_version<'3.11'",
28-
ROOT,
29-
]
25+
dependencies = ["pytest", ROOT]
3026
if session.posargs == ["coverage"]:
3127
dependencies.append("coverage[toml]")
3228
session.install(*dependencies)

referencing/tests/test_referencing_suite.py

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
from pathlib import Path
2+
import json
23
import os
34

4-
try:
5-
import tomllib as toml
6-
except ImportError:
7-
import tomli as toml
8-
95
import pytest
106

117
from referencing import Registry, Resource
@@ -22,16 +18,16 @@ def __str__(self):
2218

2319

2420
if "REFERENCING_SUITE" in os.environ:
25-
REFERENCING_SUITE = Path(os.environ["REFERENCING_SUITE"])
21+
REFERENCING_SUITE = Path(os.environ["REFERENCING_SUITE"]) / "tests"
2622
else:
27-
REFERENCING_SUITE = Path(__file__).parent.parent.parent / "suite"
23+
REFERENCING_SUITE = Path(__file__).parent.parent.parent / "suite/tests"
2824
if not REFERENCING_SUITE.is_dir():
2925
raise SuiteNotFound()
3026

3127

32-
@pytest.mark.parametrize("test_path", REFERENCING_SUITE.rglob("*.toml"))
28+
@pytest.mark.parametrize("test_path", REFERENCING_SUITE.rglob("*.json"))
3329
def test_referencing_suite(test_path):
34-
loaded = toml.loads(test_path.read_text())
30+
loaded = json.loads(test_path.read_text())
3531
registry = loaded["registry"]
3632
registry = Registry().with_resources(
3733
(uri, Resource.opaque(contents=contents))

0 commit comments

Comments
 (0)