Skip to content

Commit

Permalink
Make test_export_with_non_default_frame_step compatible with Python 3…
Browse files Browse the repository at this point in the history
….11+ (#8927)

In Python 3.11, `Enum.__format__` was changed to be the same as
`Enum.__str__`, so the yielded format name ends up being `CVAT for
_SourceDataType.images 1.1`. Use the string value explicitly.

Also, remove the `str` base class from `_SourceDataType`, since it
appears to be actively misleading (as well as unnecessary).
  • Loading branch information
SpecLad authored Jan 13, 2025
1 parent 8880e11 commit af8bfe3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/python/rest_api/test_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -2681,7 +2681,7 @@ def test_can_create_task_with_validation_and_cloud_data(
assert (img.shape[0], img.shape[1]) == (img_meta.height, img_meta.width)


class _SourceDataType(str, Enum):
class _SourceDataType(Enum):
images = "images"
video = "video"

Expand Down Expand Up @@ -6490,7 +6490,7 @@ def fxt_uploaded_media_task(
with make_sdk_client(self._USERNAME) as client:
task = client.tasks.retrieve(task_id)

yield (spec, task, f"CVAT for {media_type} 1.1")
yield (spec, task, f"CVAT for {media_type.value} 1.1")

@pytest.mark.usefixtures("restore_redis_ondisk_per_function")
@parametrize("spec, task, format_name", [fixture_ref(fxt_uploaded_media_task)])
Expand Down

0 comments on commit af8bfe3

Please sign in to comment.