diff --git a/reframe/frontend/filters.py b/reframe/frontend/filters.py index 9edf3ced3b..58c25f687c 100644 --- a/reframe/frontend/filters.py +++ b/reframe/frontend/filters.py @@ -110,13 +110,15 @@ def _fn(case): def have_gpu_only(): def _fn(case): - return case.check.num_gpus_per_node > 0 + # NOTE: This takes into account num_gpus_per_node being None + return case.check.num_gpus_per_node return _fn def have_cpu_only(): def _fn(case): - return case.check.num_gpus_per_node == 0 + # NOTE: This takes into account num_gpus_per_node being None + return not case.check.num_gpus_per_node return _fn diff --git a/unittests/test_filters.py b/unittests/test_filters.py index ff0fa39c06..f1dd63dfaa 100644 --- a/unittests/test_filters.py +++ b/unittests/test_filters.py @@ -35,7 +35,6 @@ class _X(rfm.RegressionTest): maintainers=['A', 'B', 'C', 'D']), make_case(_X, alt_name='check2', tags={'x', 'y', 'z'}, - num_gpus_per_node=0, maintainers=['X', 'Y', 'Z']), make_case(_X, alt_name='check3', tags={'a', 'z'},