File: Copy-from-conftest.py-to-get-small_tree-fixture.patch

package info (click to toggle)
python-asdf 2.7.2-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 3,248 kB
  • sloc: python: 13,104; makefile: 125
file content (80 lines) | stat: -rw-r--r-- 2,151 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
From: Ole Streicher <olebole@debian.org>
Date: Thu, 5 Dec 2019 13:59:36 +0100
Subject: Copy from conftest.py to get small_tree fixture

Check the pytest documentation, it *should* work from conftest.py as
well, but it doesn't. No idea why.
---
 asdf/tests/test_api.py          | 7 +++++++
 asdf/tests/test_array_blocks.py | 6 ++++++
 asdf/tests/test_file_format.py  | 6 ++++++
 asdf/tests/test_generic_io.py   | 4 ++++
 4 files changed, 23 insertions(+)

diff --git a/asdf/tests/test_api.py b/asdf/tests/test_api.py
index 1c280c6..214438d 100644
--- a/asdf/tests/test_api.py
+++ b/asdf/tests/test_api.py
@@ -28,6 +28,13 @@ from .helpers import (
     assert_no_warnings,
 )
 
+from . import create_small_tree
+
+
+@pytest.fixture
+def small_tree():
+    return create_small_tree()
+
 
 def test_get_data_from_closed_file(tmpdir):
     tmpdir = str(tmpdir)
diff --git a/asdf/tests/test_array_blocks.py b/asdf/tests/test_array_blocks.py
index 9905f10..cefbbb4 100644
--- a/asdf/tests/test_array_blocks.py
+++ b/asdf/tests/test_array_blocks.py
@@ -12,6 +12,12 @@ import asdf
 from asdf import block
 from asdf import constants
 from asdf import generic_io
+from . import create_small_tree
+
+
+@pytest.fixture
+def small_tree():
+    return create_small_tree()
 
 
 def test_external_block(tmpdir):
diff --git a/asdf/tests/test_file_format.py b/asdf/tests/test_file_format.py
index 3c6bc6b..1c80e86 100644
--- a/asdf/tests/test_file_format.py
+++ b/asdf/tests/test_file_format.py
@@ -7,6 +7,12 @@ import pytest
 
 import asdf
 from asdf import generic_io
+from . import create_small_tree
+
+
+@pytest.fixture
+def small_tree():
+    return create_small_tree()
 
 
 def test_no_yaml_end_marker(tmpdir):
diff --git a/asdf/tests/test_generic_io.py b/asdf/tests/test_generic_io.py
index b7f6e17..0cd547a 100644
--- a/asdf/tests/test_generic_io.py
+++ b/asdf/tests/test_generic_io.py
@@ -18,6 +18,10 @@ from asdf.asdf import is_asdf_file
 
 from . import helpers, create_small_tree, create_large_tree
 
+@pytest.fixture
+def small_tree():
+    return create_small_tree()
+
 
 @pytest.fixture(params=[create_small_tree, create_large_tree])
 def tree(request):