Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add marker to new feature tests #1148

Merged
merged 1 commit into from
Sep 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ def pytest_configure(config):
config.addinivalue_line("markers", "reqids(ids): link a test with a requirement")
config.addinivalue_line("markers", "bugs(ids): link a test with a bug")

config.addinivalue_line("markers", "new: mark the tests for the new features")


@pytest.fixture(scope="function")
def test_dir():
Expand Down
2 changes: 0 additions & 2 deletions tests/integration/cli/test_merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
from tests.utils.test_utils import run_datum as run


@pytest.mark.v1_3_0
class MergeTest:
@pytest.fixture()
def fxt_homogenous(self, test_dir):
Expand Down Expand Up @@ -250,7 +249,6 @@ def test_merge(self, test_case, merge_policy, test_dir, helper_tc):
compare_datasets(helper_tc, expected, actual, require_media=True)


@pytest.mark.v1_3_0
class IntersectMergeTest(TestCase):
@mark_requirement(Requirements.DATUM_GENERAL_REQ)
def test_can_run_self_merge(self):
Expand Down
1 change: 1 addition & 0 deletions tests/integration/cli/test_tabular_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ def fxt_buddy(fxt_buddy_path, fxt_buddy_target):
yield Dataset.import_from(fxt_buddy_path, "tabular", target=fxt_buddy_target)


@pytest.mark.new
class TabularIntegrationTest:
@mark_requirement(Requirements.DATUM_GENERAL_REQ)
@pytest.mark.parametrize(
Expand Down
1 change: 1 addition & 0 deletions tests/integration/cli/test_video.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ def test_can_extract_keyframes_from_video(self):

compare_datasets(self, expected, parsed_dataset)

@pytest.mark.new
@mark_requirement(Requirements.DATUM_GENERAL_REQ)
def test_can_export_video_dataset(self):
with TestDir() as test_dir:
Expand Down
1 change: 0 additions & 1 deletion tests/unit/algorithms/test_corrector.py
Original file line number Diff line number Diff line change
Expand Up @@ -827,7 +827,6 @@ def fxt_refined_det_dataset(fxt_original_det_dataset):
return refined


@pytest.mark.v1_3_0
class ValidationCorrectionTest:
@pytest.mark.parametrize(
"fxt_original_dataset, fxt_validator, fxt_refined_dataset",
Expand Down
1 change: 1 addition & 0 deletions tests/unit/data_formats/test_roboflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@ def fxt_tfrecord_dataset():
IDS = ["COCO", "VOC", "YOLO", "YOLO_OBB", "CREATE_ML", "MULTICLASS"]


@pytest.mark.new
class RoboflowImporterTest(TestDataFormatBase):
@pytest.mark.parametrize(
["fxt_dataset_dir", "importer"],
Expand Down
1 change: 1 addition & 0 deletions tests/unit/test_configurable_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -469,6 +469,7 @@ def fxt_dataset():
}


@pytest.mark.new
class ConfigurableValidatorTest:
@pytest.mark.parametrize(
"fxt_tasks,fxt_warnings",
Expand Down
1 change: 1 addition & 0 deletions tests/unit/test_framework_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@ def fxt_dataset():
)


@pytest.mark.new
@mark_requirement(Requirements.DATUM_GENERAL_REQ)
class FrameworkConverterFactoryTest(TestCase):
@skipIf(not TORCH_AVAILABLE, reason="PyTorch is not installed")
Expand Down
1 change: 1 addition & 0 deletions tests/unit/test_tabular_format.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ def fxt_buddy(fxt_tabular_root, fxt_buddy_target):
yield Dataset.import_from(path, "tabular", target=fxt_buddy_target)


@pytest.mark.new
class TabularImporterTest:
@mark_requirement(Requirements.DATUM_GENERAL_REQ)
def test_can_import_tabular_file(self, txf_electricity) -> None:
Expand Down
2 changes: 2 additions & 0 deletions tests/unit/test_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from unittest import TestCase

import numpy as np
import pytest

from datumaro.components.annotation import (
AnnotationType,
Expand Down Expand Up @@ -894,6 +895,7 @@ def test_validate_annotations_classification(self):

self.assertEqual(actual_summary, expected_summary)

@pytest.mark.new
@mark_requirement(Requirements.DATUM_GENERAL_REQ)
def test_validate_multilabel_annotations_classification(self):
label_cat = LabelCategories.from_iterable(["car", "bicycle", "dog", "cat", "plate", "pan"])
Expand Down
1 change: 1 addition & 0 deletions tests/unit/test_video.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,6 +250,7 @@ def test_can_release_resources_on_checkout(self, fxt_sample_video):
assert len(project.working_tree.make_dataset()) == 1


@pytest.mark.new
class VideoAnnotationTest:
@mark_requirement(Requirements.DATUM_GENERAL_REQ)
@pytest.mark.parametrize("dataset_format", ["datumaro", "datumaro_binary"])
Expand Down
1 change: 1 addition & 0 deletions tests/unit/transforms/test_sam_transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ def create_bbox_item(n_bboxes: int, n_labels: int, idx: int) -> DatasetItem:
return DatasetItem(id=f"test_{idx}", media=media, annotations=annotations)


@pytest.mark.new
class SAMModelInterpreterTest:
def test_encoder(self):
interp = SAMEncoderInterpreter()
Expand Down
5 changes: 4 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,17 @@ commands =

[testenv:validation]
commands =
python -m pytest -v --csv={toxworkdir}/results_val_{envname}.csv -m {posargs:v1_3_0}
python -m pytest -v --csv={toxworkdir}/results_val_{envname}.csv -m {posargs:new}


[testenv:stability-{darwin,lin,win}]
deps =
{[testenv]deps}
pytest-loop
allowlist_externals =
bash
commands_pre =
bash -c 'cargo -V; echo "cargo (rust) version checking exit code = $?"'
python -m pip uninstall pytest-stress -y
commands =
python -m pytest -v --csv={toxworkdir}/results-{envname}.csv -x {posargs:--loop 5}
Loading