MCPcopy Index your code
hub / github.com/ipython/ipython / test_mktempfile

Method test_mktempfile

tests/test_interactiveshell.py:557–565  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

555 self.assertEqual(values, [chr(0xD8FF), "\\ud8ff"])
556
557 def test_mktempfile(self):
558 filename = ip.mktempfile()
559 # Check that we can open the file again on Windows
560 with open(filename, "w", encoding="utf-8") as f:
561 f.write("abc")
562
563 filename = ip.mktempfile(data="blah")
564 with open(filename, "r", encoding="utf-8") as f:
565 self.assertEqual(f.read(), "blah")
566
567 def test_new_main_mod(self):
568 # Smoketest to check that this accepts a unicode module name

Callers

nothing calls this directly

Calls 3

mktempfileMethod · 0.80
readMethod · 0.80
writeMethod · 0.45

Tested by

no test coverage detected