MCPcopy Create free account
hub / github.com/ipython/traitlets / test_bad_input

Method test_bad_input

tests/utils/test_importstring.py:21–27  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

19 self.assertIs(os.path.join, import_item("os.path.join"))
20
21 def test_bad_input(self):
22 class NotAString:
23 pass
24
25 msg = "import_item accepts strings, not '%s'." % NotAString
26 with self.assertRaisesRegex(TypeError, msg):
27 import_item(NotAString()) # type:ignore[arg-type]

Callers

nothing calls this directly

Calls 2

import_itemFunction · 0.90
NotAStringClass · 0.85

Tested by

no test coverage detected