Skip to content

Commit 9586071

Browse files
authored
Add Skip test in TestTranschex (#8416)
Fixes #8415 Skip test if too many requests for huggingface hub to avoid block test. ### Types of changes <!--- Put an `x` in all the boxes that apply, and remove the not applicable items --> - [x] Non-breaking change (fix or new feature that would not break existing functionality). - [ ] Breaking change (fix or new feature that would cause existing functionality to change). - [ ] New tests added to cover the changes. - [ ] Integration tests passed locally by running `./runtests.sh -f -u --net --coverage`. - [ ] Quick tests passed locally by running `./runtests.sh --quick --unittests --disttests`. - [ ] In-line docstrings updated. - [ ] Documentation updated, tested `make html` command in the `docs/` folder. Signed-off-by: YunLiu <55491388+KumoLiu@users.noreply.github.com>
1 parent 6c8de35 commit 9586071

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

tests/networks/nets/test_transchex.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
from monai.networks import eval_mode
2020
from monai.networks.nets.transchex import Transchex
21-
from tests.test_utils import skip_if_quick
21+
from tests.test_utils import skip_if_downloading_fails, skip_if_quick
2222

2323
TEST_CASE_TRANSCHEX = []
2424
for drop_out in [0.4]:
@@ -49,7 +49,8 @@
4949
class TestTranschex(unittest.TestCase):
5050
@parameterized.expand(TEST_CASE_TRANSCHEX)
5151
def test_shape(self, input_param, expected_shape):
52-
net = Transchex(**input_param)
52+
with skip_if_downloading_fails():
53+
net = Transchex(**input_param)
5354
with eval_mode(net):
5455
result = net(torch.randint(2, (2, 512)), torch.randint(2, (2, 512)), torch.randn((2, 3, 224, 224)))
5556
self.assertEqual(result.shape, expected_shape)

0 commit comments

Comments
 (0)