Skip to content

Commit

Permalink
Merge pull request #252 from EliahKagan/importlib
Browse files Browse the repository at this point in the history
tests: Migrate from pkg_resources to importlib.resources
  • Loading branch information
cwacek authored Sep 12, 2023
2 parents 467166c + 5e0ee8e commit 1756288
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions conftest.py
Original file line number Diff line number Diff line change
@@ -1,20 +1,19 @@
import importlib.resources
import json

import pytest

import json
import pkg_resources
import os
import python_jsonschema_objects as pjs
import python_jsonschema_objects.markdown_support


@pytest.fixture
def markdown_examples():
md = pkg_resources.resource_filename(
with importlib.resources.path(
"python_jsonschema_objects.examples", "README.md"
)
examples = python_jsonschema_objects.markdown_support.extract_code_blocks(md)
examples = {json.loads(v)["title"]: json.loads(v) for v in examples["schema"]}
return examples
) as md:
examples = pjs.markdown_support.extract_code_blocks(md)

return {json.loads(v)["title"]: json.loads(v) for v in examples["schema"]}


@pytest.fixture(autouse=True)
Expand Down

0 comments on commit 1756288

Please sign in to comment.