We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e8cb21a commit 55cab3dCopy full SHA for 55cab3d
conftest.py
@@ -9,9 +9,16 @@
9
10
@pytest.fixture
11
def markdown_examples():
12
- with importlib.resources.as_file(
13
- importlib.resources.files("python_jsonschema_objects.examples") / "README.md"
14
- ) as md:
+ if hasattr(importlib.resources, "as_file"):
+ filehandle = importlib.resources.as_file(
+ importlib.resources.files("python_jsonschema_objects.examples")
15
+ / "README.md"
16
+ )
17
+ else:
18
+ filehandle = importlib.resources.path(
19
+ "python_jsonschema_objects.examples", "README.md"
20
21
+ with filehandle as md:
22
examples = pjs.markdown_support.extract_code_blocks(md)
23
24
return {json.loads(v)["title"]: json.loads(v) for v in examples["schema"]}
0 commit comments