Commit 310cd3e
committed
Mark real multi-device tests with @pytest.mark.multi_device
test_distribution and test_layout_map_mesh_shapes were not marked, so the
dedicated multi_device CI job (added in keras-team#2809, filtering on
-m "multi_device and not kaggle_key_required and not extra_large") would
never collect any real test from this model, staying green while doing
nothing. test_layout_map_live_presets already carries the marker (plus
kaggle_key_required + extra_large) and is left as-is, correctly excluded
from this job by design.
For test_layout_map_mesh_shapes, the marker is placed as the innermost
decorator (directly above the function, below
@parameterized.named_parameters(...)), not outermost: absl.testing.parameterized
expands each parameter case into a new function via functools.wraps, which
only copies attributes already present on the wrapped function's __dict__
at expansion time. Placing pytest.mark above named_parameters sets
pytestmark on the intermediate _ParameterizedTestIter object, which is
discarded once the metaclass expands per-case methods, silently losing the
marker on every generated case. Verified empirically via --collect-only:
outer placement collected 0 of 12 parameterized cases under
-m multi_device; inner placement collects all 12.1 parent 43a9bd8 commit 310cd3e
1 file changed
Lines changed: 2 additions & 0 deletions
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
230 | 230 | | |
231 | 231 | | |
232 | 232 | | |
| 233 | + | |
233 | 234 | | |
234 | 235 | | |
235 | 236 | | |
| |||
295 | 296 | | |
296 | 297 | | |
297 | 298 | | |
| 299 | + | |
298 | 300 | | |
299 | 301 | | |
300 | 302 | | |
| |||
0 commit comments