Skip to content

Commit

Permalink
add with_lazy_tree fixture, use for several tests
Browse files Browse the repository at this point in the history
  • Loading branch information
braingram committed Jan 16, 2024
1 parent 0bba278 commit 570c758
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
7 changes: 7 additions & 0 deletions asdf/_tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,10 @@ def rhttpserver(request):
server = RangeHTTPServer()
yield server
server.finalize()


@pytest.fixture(params=[True, False], ids=["lazy", "not-lazy"])
def with_lazy_tree(request):
with config.config_context() as cfg:
cfg.lazy_tree = request.param
yield
2 changes: 1 addition & 1 deletion asdf/_tests/test_extension.py
Original file line number Diff line number Diff line change
Expand Up @@ -898,7 +898,7 @@ def from_yaml_tree(self, node, tag, ctx):
config.add_extension(extension)


def test_reference_cycle(tmp_path):
def test_reference_cycle(tmp_path, with_lazy_tree):
class FractionWithInverse(fractions.Fraction):
def __init__(self, *args, **kwargs):
self._inverse = None
Expand Down
2 changes: 1 addition & 1 deletion asdf/_tests/test_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from . import _helpers as helpers


def test_undefined_tag():
def test_undefined_tag(with_lazy_tree):
# This tests makes sure that ASDF still returns meaningful structured data
# even when it encounters a schema tag that it does not specifically
# implement as an extension
Expand Down
2 changes: 1 addition & 1 deletion asdf/_tests/test_yaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from . import _helpers as helpers


def test_ordered_dict(tmp_path):
def test_ordered_dict(tmp_path, with_lazy_tree):
"""
Test that we can write out and read in ordered dicts.
"""
Expand Down

0 comments on commit 570c758

Please sign in to comment.