Skip to content

Commit 3cb4865

Browse files
committed
Speed up tests
1 parent 8a91d7f commit 3cb4865

File tree

4 files changed

+9
-9
lines changed

4 files changed

+9
-9
lines changed

tests/test_data_manager.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@
77
from hpobench.util.test_utils import DEFAULT_SKIP_MSG, check_run_all_tests
88

99

10-
@pytest.mark.skipif(check_run_all_tests(), reason=DEFAULT_SKIP_MSG)
10+
@pytest.mark.skipif(not check_run_all_tests(), reason=DEFAULT_SKIP_MSG)
1111
def test_nasbench_201_load_thread_safe():
1212
shutil.rmtree(hpobench.config_file.data_dir / "nasbench_201", ignore_errors=True)
1313
function = lambda: NASBench_201Data(dataset='cifar100').load()
1414
with Pool(3) as pool:
1515
pool.map(function, [])
1616

1717

18-
@pytest.mark.skipif(check_run_all_tests(), reason=DEFAULT_SKIP_MSG)
18+
@pytest.mark.skipif(not check_run_all_tests(), reason=DEFAULT_SKIP_MSG)
1919
def test_nasbench_201_init():
2020

2121
data_manager = NASBench_201Data(dataset='cifar100')
@@ -29,7 +29,7 @@ def test_nasbench_201_init():
2929
assert data_manager._save_dir.exists()
3030

3131

32-
@pytest.mark.skipif(check_run_all_tests(), reason=DEFAULT_SKIP_MSG)
32+
@pytest.mark.skipif(not check_run_all_tests(), reason=DEFAULT_SKIP_MSG)
3333
def test_nasbench_201_load():
3434

3535
shutil.rmtree(hpobench.config_file.data_dir / "nasbench_201", ignore_errors=True)

tests/test_mo_cnn.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from hpobench.util.test_utils import DEFAULT_SKIP_MSG, check_run_all_tests
33

44

5-
@pytest.mark.skipif(check_run_all_tests(), reason=DEFAULT_SKIP_MSG)
5+
@pytest.mark.skipif(not check_run_all_tests(), reason=DEFAULT_SKIP_MSG)
66
def test_mo_cnn_seeding():
77
from hpobench.container.benchmarks.mo.cnn_benchmark import FlowerCNNBenchmark
88
b1 = FlowerCNNBenchmark(rng=0)

tests/test_nasbench_201.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def enable_debug():
1515
disable_container_debug()
1616

1717

18-
@pytest.mark.skipif(check_run_all_tests(), reason=DEFAULT_SKIP_MSG)
18+
@pytest.mark.skipif(not check_run_all_tests(), reason=DEFAULT_SKIP_MSG)
1919
def test_nasbench201_cifar10valid(enable_debug):
2020

2121
b = Cifar10ValidNasBench201Benchmark(rng=0)
@@ -50,7 +50,7 @@ def test_nasbench201_cifar10valid(enable_debug):
5050
result = b.objective_function_test(configuration=config, fidelity={'epoch': 10})
5151

5252

53-
@pytest.mark.skipif(check_run_all_tests(), reason=DEFAULT_SKIP_MSG)
53+
@pytest.mark.skipif(not check_run_all_tests(), reason=DEFAULT_SKIP_MSG)
5454
def test_nasbench201_cifar100(enable_debug):
5555
b = Cifar100NasBench201Benchmark(rng=0)
5656

@@ -70,7 +70,7 @@ def test_nasbench201_cifar100(enable_debug):
7070
assert result['info']['valid_cost'] == result['cost']
7171

7272

73-
@pytest.mark.skipif(check_run_all_tests(), reason=DEFAULT_SKIP_MSG)
73+
@pytest.mark.skipif(not check_run_all_tests(), reason=DEFAULT_SKIP_MSG)
7474
def test_nasbench201_Image(enable_debug):
7575
b = ImageNetNasBench201Benchmark(rng=0)
7676
config = {'1<-0': 'nor_conv_1x1',

tests/test_pybnn.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def test_bnn_boston_housing():
6363
assert test_result['info']['fidelity']['budget'] == 1000
6464

6565

66-
@pytest.mark.skipif(check_run_all_tests(), reason=DEFAULT_SKIP_MSG)
66+
@pytest.mark.skipif(not check_run_all_tests(), reason=DEFAULT_SKIP_MSG)
6767
def test_bnn_protein():
6868
benchmark = BNNOnProteinStructure(rng=1)
6969
test_result = simple_call(benchmark)
@@ -72,7 +72,7 @@ def test_bnn_protein():
7272
assert test_result['info']['fidelity']['budget'] == 1000
7373

7474

75-
@pytest.mark.skipif(check_run_all_tests(), reason=DEFAULT_SKIP_MSG)
75+
@pytest.mark.skipif(not check_run_all_tests(), reason=DEFAULT_SKIP_MSG)
7676
def test_year_pred():
7777
benchmark = BNNOnYearPrediction(rng=1)
7878
test_result = simple_call(benchmark)

0 commit comments

Comments
 (0)