diff --git a/recipe_modules/infra_paths/api.py b/recipe_modules/infra_paths/api.py index 1b902826f1..7fd3e1ccd7 100644 --- a/recipe_modules/infra_paths/api.py +++ b/recipe_modules/infra_paths/api.py @@ -29,9 +29,10 @@ class InfraPathsApi(recipe_api.RecipeApi): else: self.set_config('buildbot') - for path in self._test_data.get('exists', []): - assert isinstance(path.base, NamedBasePath) - self.m.path.mock_add_paths(self[path.base.name].join(*path.pieces)) + if self._test_data.enabled: + for path in self._test_data.get('exists', []): + assert isinstance(path.base, NamedBasePath) + self.m.path.mock_add_paths(self[path.base.name].join(*path.pieces)) def __getitem__(self, name): self._lazy_set_config()