From 4d67696b42991127eae6d725ec8e926d4d4e8224 Mon Sep 17 00:00:00 2001 From: H Gazula Date: Tue, 19 Mar 2024 18:04:03 -0400 Subject: [PATCH] skip testing big models --- nobrainer/models/attention_unet.py | 2 +- nobrainer/models/tests/models_test.py | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/nobrainer/models/attention_unet.py b/nobrainer/models/attention_unet.py index 1bad990b..7b155daf 100644 --- a/nobrainer/models/attention_unet.py +++ b/nobrainer/models/attention_unet.py @@ -1,6 +1,6 @@ """Model definition for Attention U-Net. Adapted from https://github.com/nikhilroxtomar/Semantic-Segmentation-Architecture/blob/main/TensorFlow/attention-unet.py -""" +""" # noqa: E501 from tensorflow.keras import layers import tensorflow.keras.layers as L diff --git a/nobrainer/models/tests/models_test.py b/nobrainer/models/tests/models_test.py index f9a6da35..c0e8f030 100644 --- a/nobrainer/models/tests/models_test.py +++ b/nobrainer/models/tests/models_test.py @@ -1,3 +1,5 @@ +import os + import numpy as np import pytest import tensorflow as tf @@ -21,6 +23,8 @@ from ..vnet import vnet from ..vox2vox import Vox_ensembler, vox_gan +IN_GITHUB_ACTIONS = os.getenv("GITHUB_ACTIONS") == "true" + def model_test(model_cls, n_classes, input_shape, kwds={}): """Tests for models.""" @@ -257,9 +261,11 @@ def test_attention_unet_with_inception(): ) +@pytest.mark.skipif(IN_GITHUB_ACTIONS, reason="Cannot test in GitHub Actions") def test_unetr(): model_test(unetr, n_classes=1, input_shape=(1, 96, 96, 96, 1)) +@pytest.mark.skipif(IN_GITHUB_ACTIONS, reason="Cannot test in GitHub Actions") def test_variational_meshnet(): model_test(variational_meshnet, n_classes=1, input_shape=(1, 128, 128, 128, 1))