def python_modules_except_usefully_on_unpicklable_modules(self): # Re: #556; when bug present, a TypeError pops up instead (granted, # at merge time, but we want it to raise ASAP, so we're testing the # intended new behavior: raising at config load time. c = Config() c.set_runtime_path(join(support, "has_modules.py")) expected = r"'os' is a module.*giving a tasks file.*mistake" with pytest.raises(UnpicklableConfigMember, match=expected): c.load_runtime(merge=False)
def non_missing_file_IOErrors_are_raised(self): c = Config() c._load_yml = Mock(side_effect=IOError(17, "uh, what?")) c.set_runtime_path("is-a.yml") # Triggers use of _load_yml c.load_runtime()
def nonexistent_files_are_skipped_and_logged(self, mock_debug): c = Config() c._load_yml = Mock(side_effect=IOError(2, "aw nuts")) c.set_runtime_path("is-a.yml") # Triggers use of _load_yml c.load_runtime() mock_debug.assert_any_call("Didn't see any is-a.yml, skipping.")