Skip to content

Commit

Permalink
ignore some windows unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
LeoXing1996 committed Dec 30, 2022
1 parent 065bfe4 commit 496542f
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/test_models/test_editors/test_wgan_gp/test_wgan_gp.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
# Copyright (c) OpenMMLab. All rights reserved.
import platform
from copy import deepcopy
from unittest import TestCase

import pytest
import torch
from mmengine import MessageHub
from mmengine.optim import OptimWrapper, OptimWrapperDict
Expand Down Expand Up @@ -54,6 +56,9 @@ def test_init(self):
gan = WGANGP(generator=gen, data_preprocessor=GenDataPreprocessor())
self.assertEqual(gan.discriminator, None)

@pytest.mark.skipif(
'win' in platform.system().lower() and 'cu' in torch.__version__,
reason='skip on windows-cuda due to limited RAM.')
def test_train_step(self):
# prepare model
accu_iter = 1
Expand Down
5 changes: 5 additions & 0 deletions tests/test_models/test_losses/test_feature_loss.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
# Copyright (c) OpenMMLab. All rights reserved.
import platform

import pytest
import torch

from mmedit.models.losses import LightCNNFeatureLoss


@pytest.mark.skipif(
'win' in platform.system().lower() and 'cu' in torch.__version__,
reason='skip on windows-cuda due to limited RAM.')
def test_light_cnn_feature_loss():

pretrained = 'https://download.openmmlab.com/mmediting/' + \
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
# Copyright (c) OpenMMLab. All rights reserved.
import platform

import pytest
import torch
from mmengine.utils.dl_utils import TORCH_VERSION
Expand All @@ -15,6 +17,9 @@ def setup_class(cls):
cls.data_info = dict(generator='generator', num_batches='num_batches')
cls.gen = StyleGAN2Generator(32, 10, num_mlps=2)

@pytest.mark.skipif(
'win' in platform.system().lower() and 'cu' in torch.__version__,
reason='skip on windows-cuda due to limited RAM.')
def test_path_regularizer_cpu(self):
gen = self.gen

Expand Down
4 changes: 4 additions & 0 deletions tests/test_models/test_losses/test_perceptual_loss.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright (c) OpenMMLab. All rights reserved.
import platform
from unittest.mock import patch

import pytest
Expand All @@ -8,6 +9,9 @@
TransferalPerceptualLoss)


@pytest.mark.skipif(
'win' in platform.system().lower() and 'cu' in torch.__version__,
reason='skip on windows-cuda due to limited RAM.')
@patch.object(PerceptualVGG, 'init_weights')
def test_perceptual_loss(init_weights):
if torch.cuda.is_available():
Expand Down

0 comments on commit 496542f

Please sign in to comment.