MCPcopy Create free account
hub / github.com/ipython/ipython / writefile

Method writefile

IPython/core/tests/test_run.py:435–441  ·  view source on GitHub ↗
(self, name, content)

Source from the content-addressed store, hash-verified

433class TestMagicRunWithPackage(unittest.TestCase):
434
435 def writefile(self, name, content):
436 path = os.path.join(self.tempdir.name, name)
437 d = os.path.dirname(path)
438 if not os.path.isdir(d):
439 os.makedirs(d)
440 with open(path, 'w') as f:
441 f.write(textwrap.dedent(content))
442
443 def setUp(self):
444 self.package = package = 'tmp{0}'.format(''.join([random.choice(string.ascii_letters) for i in range(10)]))

Callers 1

setUpMethod · 0.95

Calls 1

writeMethod · 0.45

Tested by

no test coverage detected