Skip to content

Commit fd05cef

Browse files
committed
Add 'slow' marker to pytest config and tests
1 parent aa53622 commit fd05cef

2 files changed

Lines changed: 11 additions & 13 deletions

File tree

pytest.ini

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
[pytest]
22
markers =
3-
functional: functional tests
3+
functional: Functional tests (high-level)
4+
slow: Slow tests
45

56
filterwarnings =
67
# Suppress NumPy deprecation warning from Keras/TensorFlow about np.object
78
ignore::FutureWarning:keras.*
89
ignore::FutureWarning:tensorflow.*
9-
ignore:In the future `np.object` will be defined:FutureWarning
10+
ignore:In the future `np.object` will be defined:FutureWarning

tests/test_benchmark_script.py

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import glob
2+
23
import pytest
4+
35
from dlclive import benchmark_videos, download_benchmarking_data
46
from dlclive.engine import Engine
57

@@ -10,7 +12,9 @@ def datafolder(tmp_path):
1012
download_benchmarking_data(str(datafolder))
1113
return datafolder
1214

15+
1316
@pytest.mark.functional
17+
@pytest.mark.slow
1418
def test_benchmark_script_runs_tf_backend(tmp_path, datafolder):
1519
dog_models = glob.glob(str(datafolder / "dog" / "*[!avi]"))
1620
dog_video = glob.glob(str(datafolder / "dog" / "*.avi"))[0]
@@ -27,11 +31,7 @@ def test_benchmark_script_runs_tf_backend(tmp_path, datafolder):
2731
print(f"Running dog model: {model_path}")
2832
benchmark_videos(
2933
model_path=model_path,
30-
model_type=(
31-
"base"
32-
if Engine.from_model_path(model_path) == Engine.TENSORFLOW
33-
else "pytorch"
34-
),
34+
model_type=("base" if Engine.from_model_path(model_path) == Engine.TENSORFLOW else "pytorch"),
3535
video_path=dog_video,
3636
output=str(out_dir),
3737
n_frames=n_frames,
@@ -42,11 +42,7 @@ def test_benchmark_script_runs_tf_backend(tmp_path, datafolder):
4242
print(f"Running mouse model: {model_path}")
4343
benchmark_videos(
4444
model_path=model_path,
45-
model_type=(
46-
"base"
47-
if Engine.from_model_path(model_path) == Engine.TENSORFLOW
48-
else "pytorch"
49-
),
45+
model_type=("base" if Engine.from_model_path(model_path) == Engine.TENSORFLOW else "pytorch"),
5046
video_path=mouse_video,
5147
output=str(out_dir),
5248
n_frames=n_frames,
@@ -58,6 +54,7 @@ def test_benchmark_script_runs_tf_backend(tmp_path, datafolder):
5854

5955
@pytest.mark.parametrize("model_name", ["hrnet_w32", "resnet_50"])
6056
@pytest.mark.functional
57+
@pytest.mark.slow
6158
def test_benchmark_script_with_torch_modelzoo(tmp_path, datafolder, model_name):
6259
from dlclive import modelzoo
6360

@@ -107,4 +104,4 @@ def test_benchmark_script_with_torch_modelzoo(tmp_path, datafolder, model_name):
107104
# Assertions: verify output files were created
108105
output_files = list(out_dir.iterdir())
109106
assert len(output_files) > 0, "No output files were created by benchmark_videos"
110-
assert any(f.suffix == ".pickle" for f in output_files), "No pickle files found in output directory"
107+
assert any(f.suffix == ".pickle" for f in output_files), "No pickle files found in output directory"

0 commit comments

Comments
 (0)