MCPcopy Create free account
hub / github.com/pallets/werkzeug / test_import_string_attribute_error

Function test_import_string_attribute_error

tests/test_utils.py:227–240  ·  view source on GitHub ↗
(tmpdir, monkeypatch)

Source from the content-addressed store, hash-verified

225
226
227def test_import_string_attribute_error(tmpdir, monkeypatch):
228 monkeypatch.syspath_prepend(str(tmpdir))
229 tmpdir.join("foo_test.py").write("from bar_test import value")
230 tmpdir.join("bar_test.py").write("raise AttributeError('bad')")
231
232 with pytest.raises(AttributeError) as info:
233 utils.import_string("foo_test")
234
235 assert "bad" in str(info.value)
236
237 with pytest.raises(AttributeError) as info:
238 utils.import_string("bar_test")
239
240 assert "bad" in str(info.value)
241
242
243def test_find_modules():

Callers

nothing calls this directly

Calls 2

joinMethod · 0.80
writeMethod · 0.45

Tested by

no test coverage detected