Skip to content

Commit 9e70cb5

Browse files
committed
🧪 Add test markers to pyproject.toml
1 parent 8f37b99 commit 9e70cb5

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

‎pyproject.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,9 @@ markers = [
108108
"metadata: tests of metadata gathering functions",
109109
"online: tests for online functionality",
110110
"offline: tests for offline functionality",
111-
"local: tests of functionality which do not involve a server or writing to an offline cache file"
111+
"local: tests of functionality which do not involve a server or writing to an offline cache file",
112+
"object_retrieval: tests relating to retrieval of objects from the server",
113+
"object_removal: tests relating to removal of objects from the server",
112114
]
113115

114116
[tool.interrogate]

‎tests/functional/test_client.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,14 @@
1919

2020

2121
@pytest.mark.client
22+
@pytest.mark.object_retrieval
2223
def test_get_events(create_test_run: tuple[sv_run.Run, dict]) -> None:
2324
client = svc.Client()
2425
assert client.get_events(run_id=create_test_run[1]["run_id"])
2526

2627

2728
@pytest.mark.client
29+
@pytest.mark.object_retrieval
2830
@pytest.mark.parametrize("from_run", (True, False), ids=("from_run", "all_runs"))
2931
@pytest.mark.parametrize("names_only", (True, False), ids=("names_only", "all_details"))
3032
@pytest.mark.parametrize(
@@ -96,6 +98,7 @@ def test_get_alerts(
9698

9799

98100
@pytest.mark.client
101+
@pytest.mark.object_retrieval
99102
def test_get_run_id_from_name(create_test_run: tuple[sv_run.Run, dict]) -> None:
100103
client = svc.Client()
101104
assert (
@@ -105,6 +108,7 @@ def test_get_run_id_from_name(create_test_run: tuple[sv_run.Run, dict]) -> None:
105108

106109

107110
@pytest.mark.client
111+
@pytest.mark.object_retrieval
108112
@pytest.mark.parametrize(
109113
"aggregate,use_name_labels",
110114
[(True, False), (False, False), (False, True)],
@@ -138,6 +142,7 @@ def test_get_metric_values(
138142

139143

140144
@pytest.mark.client
145+
@pytest.mark.object_retrieval
141146
def test_plot_metrics(create_test_run: tuple[sv_run.Run, dict]) -> None:
142147
try:
143148
import matplotlib
@@ -153,6 +158,7 @@ def test_plot_metrics(create_test_run: tuple[sv_run.Run, dict]) -> None:
153158

154159

155160
@pytest.mark.client
161+
@pytest.mark.object_retrieval
156162
@pytest.mark.parametrize(
157163
"sorting",
158164
([("metadata.test_identifier", True)], [("name", True), ("created", True)], None),
@@ -169,6 +175,7 @@ def test_get_artifacts_entries(
169175

170176

171177
@pytest.mark.client
178+
@pytest.mark.object_retrieval
172179
@pytest.mark.parametrize("file_id", (1, 2, 3), ids=lambda x: f"file_{x}")
173180
def test_get_artifact_as_file(
174181
create_test_run: tuple[sv_run.Run, dict], file_id: int
@@ -187,6 +194,7 @@ def test_get_artifact_as_file(
187194

188195

189196
@pytest.mark.client
197+
@pytest.mark.object_retrieval
190198
@pytest.mark.parametrize("category", (None, "code", "input", "output"))
191199
def test_get_artifacts_as_files(
192200
create_test_run: tuple[sv_run.Run, dict],
@@ -216,6 +224,7 @@ def test_get_artifacts_as_files(
216224

217225

218226
@pytest.mark.client
227+
@pytest.mark.object_retrieval
219228
@pytest.mark.parametrize(
220229
"output_format,sorting",
221230
[
@@ -243,12 +252,14 @@ def test_get_runs(
243252

244253

245254
@pytest.mark.client
255+
@pytest.mark.object_retrieval
246256
def test_get_run(create_test_run: tuple[sv_run.Run, dict]) -> None:
247257
client = svc.Client()
248258
assert client.get_run(run_id=create_test_run[1]["run_id"])
249259

250260

251261
@pytest.mark.client
262+
@pytest.mark.object_retrieval
252263
@pytest.mark.parametrize(
253264
"sorting",
254265
(None, [("metadata.test_identifier", True), ("path", True)], [("modified", False)]),
@@ -265,6 +276,7 @@ def test_get_folders(
265276

266277

267278
@pytest.mark.client
279+
@pytest.mark.object_retrieval
268280
def test_get_metrics_names(create_test_run: tuple[sv_run.Run, dict]) -> None:
269281
client = svc.Client()
270282
attempts: int = 0
@@ -281,6 +293,7 @@ def test_get_metrics_names(create_test_run: tuple[sv_run.Run, dict]) -> None:
281293

282294

283295
@pytest.mark.client
296+
@pytest.mark.object_retrieval
284297
def test_get_tag(create_plain_run: tuple[sv_run.Run, dict]) -> None:
285298
_, run_data = create_plain_run
286299
client = svc.Client()
@@ -297,6 +310,7 @@ def test_get_tag(create_plain_run: tuple[sv_run.Run, dict]) -> None:
297310

298311

299312
@pytest.mark.client
313+
@pytest.mark.object_removal
300314
def test_run_deletion() -> None:
301315
run = sv_run.Run()
302316
run.init(
@@ -314,6 +328,7 @@ def test_run_deletion() -> None:
314328

315329

316330
@pytest.mark.client
331+
@pytest.mark.object_removal
317332
def test_runs_deletion() -> None:
318333
_runs = [sv_run.Run() for _ in range(5)]
319334
for i, run in enumerate(_runs):
@@ -332,6 +347,7 @@ def test_runs_deletion() -> None:
332347

333348

334349
@pytest.mark.client
350+
@pytest.mark.object_retrieval
335351
def test_get_tags() -> None:
336352
_uuid = f"{uuid.uuid4()}".split("-")[0]
337353
tags = ["simvue_unit_testing", "test_get_tags", "testing", _uuid]
@@ -358,6 +374,7 @@ def test_get_tags() -> None:
358374

359375

360376
@pytest.mark.client
377+
@pytest.mark.object_removal
361378
def test_folder_deletion() -> None:
362379
run = sv_run.Run()
363380
_temp_folder_id: str = f"{uuid.uuid4()}".split()[0]
@@ -386,6 +403,7 @@ def test_folder_deletion() -> None:
386403

387404

388405
@pytest.mark.client
406+
@pytest.mark.object_retrieval
389407
def test_run_folder_metadata_find() -> None:
390408
_uuid: str = f"{uuid.uuid4()}".split()[0]
391409
with sv_run.Run() as run:
@@ -404,6 +422,7 @@ def test_run_folder_metadata_find() -> None:
404422

405423

406424
@pytest.mark.client
425+
@pytest.mark.object_removal
407426
def test_tag_deletion() -> None:
408427
with sv_run.Run() as run:
409428
unique_id = f"{uuid.uuid4()}".split("-")[0]
@@ -424,6 +443,7 @@ def test_tag_deletion() -> None:
424443

425444

426445
@pytest.mark.client
446+
@pytest.mark.object_retrieval
427447
@pytest.mark.parametrize("aggregate", (True, False), ids=("aggregated", "normal"))
428448
@pytest.mark.parametrize("output_format", ("dict", "dataframe"))
429449
@pytest.mark.parametrize("xaxis", ("step", "time", "timestamp"))
@@ -461,6 +481,7 @@ def test_multiple_metric_retrieval(
461481

462482

463483
@pytest.mark.client
484+
@pytest.mark.object_removal
464485
def test_alert_deletion() -> None:
465486
_alert = sv_api_obj.UserAlert.new(
466487
name="test_alert", notification="none", description=None
@@ -473,6 +494,7 @@ def test_alert_deletion() -> None:
473494

474495

475496
@pytest.mark.client
497+
@pytest.mark.object_removal
476498
def test_abort_run(speedy_heartbeat, create_plain_run: tuple[sv_run.Run, dict]) -> None:
477499
run, run_data = create_plain_run
478500
_uuid = f"{uuid.uuid4()}".split("-")[0]

0 commit comments

Comments
 (0)