1- import logging
2- logging .basicConfig (level = logging .DEBUG )
31import pytest
42
53from hpobench .container .benchmarks .nas .nasbench_201 import ImageNetNasBench201Benchmark , Cifar100NasBench201Benchmark , \
64 Cifar10ValidNasBench201Benchmark
75from hpobench .benchmarks .nas .nasbench_201 import \
86 Cifar10ValidNasBench201MOBenchmark as LocalCifar10ValidNasBench201MOBenchmark
97from hpobench .util .container_utils import disable_container_debug , enable_container_debug
10-
11- skip_message = 'We currently skip this test because it takes too much time.'
8+ from hpobench .util .test_utils import DEFAULT_SKIP_MSG , check_run_all_tests
129
1310
1411@pytest .fixture (scope = 'module' )
@@ -18,7 +15,7 @@ def enable_debug():
1815 disable_container_debug ()
1916
2017
21- @pytest .mark .skip ( reason = skip_message )
18+ @pytest .mark .skipif ( not check_run_all_tests (), reason = DEFAULT_SKIP_MSG )
2219def test_nasbench201_cifar10valid (enable_debug ):
2320
2421 b = Cifar10ValidNasBench201Benchmark (rng = 0 )
@@ -53,7 +50,7 @@ def test_nasbench201_cifar10valid(enable_debug):
5350 result = b .objective_function_test (configuration = config , fidelity = {'epoch' : 10 })
5451
5552
56- @pytest .mark .skip ( reason = skip_message )
53+ @pytest .mark .skipif ( not check_run_all_tests (), reason = DEFAULT_SKIP_MSG )
5754def test_nasbench201_cifar100 (enable_debug ):
5855 b = Cifar100NasBench201Benchmark (rng = 0 )
5956
@@ -73,7 +70,7 @@ def test_nasbench201_cifar100(enable_debug):
7370 assert result ['info' ]['valid_cost' ] == result ['cost' ]
7471
7572
76- @pytest .mark .skip ( reason = skip_message )
73+ @pytest .mark .skipif ( not check_run_all_tests (), reason = DEFAULT_SKIP_MSG )
7774def test_nasbench201_Image (enable_debug ):
7875 b = ImageNetNasBench201Benchmark (rng = 0 )
7976 config = {'1<-0' : 'nor_conv_1x1' ,
0 commit comments