Skip to content
This repository has been archived by the owner on Oct 9, 2023. It is now read-only.

Commit

Permalink
Updates
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanwharris committed Aug 4, 2021
1 parent 16e6101 commit fbad52e
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/video/classification/test_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@
import re
import tempfile
from pathlib import Path
from unittest import mock

import pytest
import torch
from torch.utils.data import SequentialSampler

import flash
from flash.__main__ import main
from flash.core.utilities.imports import _FIFTYONE_AVAILABLE, _VIDEO_AVAILABLE
from flash.video import VideoClassificationData, VideoClassifier
from tests.helpers.utils import _VIDEO_TESTING
Expand Down Expand Up @@ -283,3 +285,13 @@ def test_jit(tmpdir):
def test_load_from_checkpoint_dependency_error():
with pytest.raises(ModuleNotFoundError, match=re.escape("'lightning-flash[video]'")):
VideoClassifier.load_from_checkpoint("not_a_real_checkpoint.pt")


@pytest.mark.skipif(not _VIDEO_TESTING, reason="PyTorchVideo isn't installed.")
def test_cli():
cli_args = ["flash", "video-classification", "--trainer.fast_dev_run", "True"]
with mock.patch("sys.argv", cli_args):
try:
main()
except SystemExit:
pass

0 comments on commit fbad52e

Please sign in to comment.