Skip to content

Flatten test folder #613

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

Merged
merged 3 commits into from
Apr 2, 2025
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: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ add_subdirectory(src/torchcodec/_core)
option(BUILD_TESTS "Build tests" OFF)
if(BUILD_TESTS)
enable_testing()
add_subdirectory(test/decoders)
add_subdirectory(test)
endif()
2 changes: 1 addition & 1 deletion test/decoders/CMakeLists.txt → test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ add_executable(

target_include_directories(VideoDecoderTest SYSTEM PRIVATE ${TORCH_INCLUDE_DIRS})
target_include_directories(VideoDecoderTest SYSTEM PRIVATE ${libav_include_dirs})
target_include_directories(VideoDecoderTest PRIVATE ../../)
target_include_directories(VideoDecoderTest PRIVATE ../)

target_link_libraries(
VideoDecoderTest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ std::string getResourcePath(const std::string& filename) {
#else
std::filesystem::path dirPath = std::filesystem::path(__FILE__);
std::string filepath =
dirPath.parent_path().string() + "/../resources/" + filename;
dirPath.parent_path().string() + "/resources/" + filename;
#endif
return filepath;
}
Expand Down
5 changes: 0 additions & 5 deletions test/decoders/__init__.py

This file was deleted.

Empty file removed test/samplers/__init__.py
Empty file.
2 changes: 1 addition & 1 deletion test/decoders/test_decoders.py → test/test_decoders.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
VideoStreamMetadata,
)

from ..utils import (
from .utils import (
assert_frames_equal,
AV1_VIDEO,
cpu_and_cuda,
Expand Down
2 changes: 1 addition & 1 deletion test/decoders/test_metadata.py → test/test_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
)
from torchcodec.decoders import AudioDecoder, VideoDecoder

from ..utils import NASA_AUDIO_MP3, NASA_VIDEO
from .utils import NASA_AUDIO_MP3, NASA_VIDEO


# TODO: Expected values in these tests should be based on the assets's
Expand Down
2 changes: 1 addition & 1 deletion test/decoders/test_ops.py → test/test_ops.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
seek_to_pts,
)

from ..utils import (
from .utils import (
assert_frames_equal,
cpu_and_cuda,
NASA_AUDIO,
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion test/samplers/test_samplers.py → test/test_samplers.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from torchcodec.samplers._index_based import _build_all_clips_indices
from torchcodec.samplers._time_based import _build_all_clips_timestamps

from ..utils import assert_frames_equal, NASA_VIDEO
from .utils import assert_frames_equal, NASA_VIDEO


def _assert_output_type_and_shapes(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
VideoClipSampler,
)

from ..utils import NASA_VIDEO
from .utils import NASA_VIDEO


@pytest.mark.parametrize(
Expand Down
Loading