Skip to content

Commit 137cd58

Browse files
committed
warn when bundled pytest plugin runs
1 parent 2df147c commit 137cd58

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

changes/1959.removal.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Deprecate the bundled pytest plugin, please install pytest-asdf-plugin to run schema tests.

pytest_asdf/plugin.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import importlib
22
import os
33
import pathlib
4+
import warnings
45
from dataclasses import dataclass
56

67
import pytest
@@ -128,6 +129,9 @@ def from_parent(cls, parent, schema_path, validate_default=True, **kwargs):
128129
def runtest(self):
129130
from asdf import schema
130131

132+
# warn inside test, we don't do this yet to allow time for downstream packages to adopt pytest-asdf-plugin
133+
warnings.warn("pytest_asdf is deprecated, install pytest_asdf_plugin instead", DeprecationWarning)
134+
131135
# Make sure that each schema itself is valid.
132136
schema_tree = schema.load_schema(
133137
self.schema_path,
@@ -205,7 +209,7 @@ def runtest(self):
205209
from asdf.testing.helpers import yaml_to_asdf
206210

207211
# warn inside test, we don't do this yet to allow time for downstream packages to adopt pytest-asdf-plugin
208-
# warnings.warn("pytest_asdf is deprecated, install pytest_asdf_plugin instead", DeprecationWarning)
212+
warnings.warn("pytest_asdf is deprecated, install pytest_asdf_plugin instead", DeprecationWarning)
209213

210214
# check the example is valid
211215
buff = yaml_to_asdf("example: " + self.example.example.strip(), version=self.example.version)

0 commit comments

Comments
 (0)