|
6 | 6 | from pathlib import Path |
7 | 7 | from typing import Any, Generator, List, MutableMapping, Optional, Tuple |
8 | 8 |
|
9 | | -import pkg_resources |
10 | 9 | import pytest |
| 10 | +from importlib_resources import files |
11 | 11 | from ruamel.yaml.comments import CommentedMap, CommentedSeq |
12 | 12 | from schema_salad.avro.schema import Names |
13 | 13 | from schema_salad.utils import yaml_no_ts |
@@ -281,12 +281,11 @@ def test_env_passing(monkeypatch: pytest.MonkeyPatch) -> None: |
281 | 281 | # Reading the schema is super slow - cache for the session |
282 | 282 | @pytest.fixture(scope="session") |
283 | 283 | def schema_ext11() -> Generator[Names, None, None]: |
284 | | - with pkg_resources.resource_stream("cwltool", "extensions-v1.1.yml") as res: |
285 | | - ext11 = res.read().decode("utf-8") |
286 | | - cwltool.process.use_custom_schema("v1.1", "http://commonwl.org/cwltool", ext11) |
287 | | - schema = cwltool.process.get_schema("v1.1")[1] |
288 | | - assert isinstance(schema, Names) |
289 | | - yield schema |
| 284 | + ext11 = files("cwltool").joinpath("extensions-v1.1.yml").read_text("utf-8") |
| 285 | + cwltool.process.use_custom_schema("v1.1", "http://commonwl.org/cwltool", ext11) |
| 286 | + schema = cwltool.process.get_schema("v1.1")[1] |
| 287 | + assert isinstance(schema, Names) |
| 288 | + yield schema |
290 | 289 |
|
291 | 290 |
|
292 | 291 | mpiReq = CommentedMap({"class": MPIRequirementName, "processes": 1}) |
|
0 commit comments