Skip to content

Commit f61fdd7

Browse files
committed
rev
1 parent e29e929 commit f61fdd7

File tree

1 file changed

+22
-22
lines changed

1 file changed

+22
-22
lines changed

Diff for: tests/conftest.py

+22-22
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def clear_cache():
1616
dak.lib.core.dak_cache.clear()
1717

1818

19-
@pytest.fixture(scope="session")
19+
@pytest.fixture()
2020
def single_record_file(tmp_path_factory: pytest.TempPathFactory) -> str:
2121
fname = tmp_path_factory.mktemp("data") / "single_record.json"
2222
record = {"record": [1, 2, 3]}
@@ -25,7 +25,7 @@ def single_record_file(tmp_path_factory: pytest.TempPathFactory) -> str:
2525
return str(fname)
2626

2727

28-
@pytest.fixture(scope="session")
28+
@pytest.fixture()
2929
def ndjson_points1(tmp_path_factory: pytest.TempPathFactory) -> str:
3030
array = daktu.awkward_xy_points()
3131
fname = tmp_path_factory.mktemp("data") / "points_ndjson1.json"
@@ -35,7 +35,7 @@ def ndjson_points1(tmp_path_factory: pytest.TempPathFactory) -> str:
3535
return str(fname)
3636

3737

38-
@pytest.fixture(scope="session")
38+
@pytest.fixture()
3939
def ndjson_points1_str(tmp_path_factory: pytest.TempPathFactory) -> str:
4040
array = daktu.awkward_xy_points_str()
4141
fname = tmp_path_factory.mktemp("data") / "points_ndjson1.json"
@@ -45,7 +45,7 @@ def ndjson_points1_str(tmp_path_factory: pytest.TempPathFactory) -> str:
4545
return str(fname)
4646

4747

48-
@pytest.fixture(scope="session")
48+
@pytest.fixture()
4949
def ndjson_points2(tmp_path_factory: pytest.TempPathFactory) -> str:
5050
array = daktu.awkward_xy_points()
5151
fname = tmp_path_factory.mktemp("data") / "points_ndjson2.json"
@@ -55,77 +55,77 @@ def ndjson_points2(tmp_path_factory: pytest.TempPathFactory) -> str:
5555
return str(fname)
5656

5757

58-
@pytest.fixture(scope="session")
58+
@pytest.fixture()
5959
def ndjson_points_file(ndjson_points1: str) -> str:
6060
return ndjson_points1
6161

6262

63-
@pytest.fixture(scope="session")
63+
@pytest.fixture()
6464
def ndjson_points_file_str(ndjson_points1_str: str) -> str:
6565
return ndjson_points1_str
6666

6767

68-
@pytest.fixture(scope="session")
68+
@pytest.fixture()
6969
def daa(ndjson_points1: str) -> dak.Array:
7070
return dak.from_json([ndjson_points1] * 3)
7171

7272

73-
@pytest.fixture(scope="session")
73+
@pytest.fixture()
7474
def pq_points_dir(daa: dak.Array, tmp_path_factory: pytest.TempPathFactory) -> str:
7575
pqdir = tmp_path_factory.mktemp("pqfiles")
7676
dak.to_parquet(daa, str(pqdir))
7777
return str(pqdir)
7878

7979

80-
@pytest.fixture(scope="session")
80+
@pytest.fixture()
8181
def daa_parquet(pq_points_dir: str) -> dak.Array:
8282
return cast(dak.Array, dak.from_parquet(pq_points_dir))
8383

8484

85-
@pytest.fixture(scope="session")
85+
@pytest.fixture()
8686
def daa_str(ndjson_points1_str: str) -> dak.Array:
8787
return dak.from_json([ndjson_points1_str] * 3)
8888

8989

90-
@pytest.fixture(scope="session")
90+
@pytest.fixture()
9191
def caa(ndjson_points1: str) -> ak.Array:
9292
with open(ndjson_points1, "rb") as f:
9393
a = ak.from_json(f, line_delimited=True)
9494
return ak.concatenate([a, a, a])
9595

9696

97-
@pytest.fixture(scope="session")
97+
@pytest.fixture()
9898
def caa_str(ndjson_points1_str: str) -> ak.Array:
9999
with open(ndjson_points1_str, "rb") as f:
100100
a = ak.from_json(f, line_delimited=True)
101101
return ak.concatenate([a, a, a])
102102

103103

104-
@pytest.fixture(scope="session")
104+
@pytest.fixture()
105105
def daa_p1(ndjson_points1: str) -> dak.Array:
106106
return dak.from_json([ndjson_points1] * 3)
107107

108108

109-
@pytest.fixture(scope="session")
109+
@pytest.fixture()
110110
def daa_p2(ndjson_points2: str) -> dak.Array:
111111
return dak.from_json([ndjson_points2] * 3)
112112

113113

114-
@pytest.fixture(scope="session")
114+
@pytest.fixture()
115115
def caa_p1(ndjson_points1: str) -> ak.Array:
116116
with open(ndjson_points1) as f:
117117
lines = [json.loads(line) for line in f]
118118
return ak.Array(lines * 3)
119119

120120

121-
@pytest.fixture(scope="session")
121+
@pytest.fixture()
122122
def caa_p2(ndjson_points2: str) -> ak.Array:
123123
with open(ndjson_points2) as f:
124124
lines = [json.loads(line) for line in f]
125125
return ak.Array(lines * 3)
126126

127127

128-
@pytest.fixture(scope="session")
128+
@pytest.fixture()
129129
def L1() -> list[list[dict[str, float]]]:
130130
return [
131131
[{"x": 1.0, "y": 1.1}, {"x": 2.0, "y": 2.2}, {"x": 3, "y": 3.3}],
@@ -136,7 +136,7 @@ def L1() -> list[list[dict[str, float]]]:
136136
]
137137

138138

139-
@pytest.fixture(scope="session")
139+
@pytest.fixture()
140140
def L2() -> list[list[dict[str, float]]]:
141141
return [
142142
[{"x": 0.9, "y": 1.0}, {"x": 2.0, "y": 2.2}, {"x": 2.9, "y": 3.0}],
@@ -147,7 +147,7 @@ def L2() -> list[list[dict[str, float]]]:
147147
]
148148

149149

150-
@pytest.fixture(scope="session")
150+
@pytest.fixture()
151151
def L3() -> list[list[dict[str, float]]]:
152152
return [
153153
[{"x": 1.9, "y": 9.0}, {"x": 2.0, "y": 8.2}, {"x": 9.9, "y": 9.0}],
@@ -158,7 +158,7 @@ def L3() -> list[list[dict[str, float]]]:
158158
]
159159

160160

161-
@pytest.fixture(scope="session")
161+
@pytest.fixture()
162162
def L4() -> list[list[dict[str, float]] | None]:
163163
return [
164164
[{"x": 1.9, "y": 9.0}, {"x": 2.0, "y": 8.2}, {"x": 9.9, "y": 9.0}],
@@ -169,14 +169,14 @@ def L4() -> list[list[dict[str, float]] | None]:
169169
]
170170

171171

172-
@pytest.fixture(scope="session")
172+
@pytest.fixture()
173173
def caa_parquet(caa: ak.Array, tmp_path_factory: pytest.TempPathFactory) -> str:
174174
fname = tmp_path_factory.mktemp("parquet_data") / "caa.parquet"
175175
ak.to_parquet(caa, str(fname), extensionarray=False)
176176
return str(fname)
177177

178178

179-
@pytest.fixture(scope="session")
179+
@pytest.fixture()
180180
def unnamed_root_parquet_file(tmp_path_factory: pytest.TempPathFactory) -> str:
181181
from dask_awkward.lib.testutils import unnamed_root_ds
182182

0 commit comments

Comments
 (0)