MCPcopy Index your code
hub / github.com/bpython/bpython / setUp

Method setUp

bpython/test/test_history.py:87–95  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

85
86class TestHistoryFileAccess(unittest.TestCase):
87 def setUp(self):
88 self.tempdir = tempfile.TemporaryDirectory()
89 self.filename = Path(self.tempdir.name) / "history_temp_file"
90 self.encoding = getpreferredencoding()
91
92 with open(
93 self.filename, "w", encoding=self.encoding, errors="ignore"
94 ) as f:
95 f.write(b"#1\n#2\n".decode())
96
97 def test_load(self):
98 history = History()

Callers

nothing calls this directly

Calls 2

getpreferredencodingFunction · 0.90
writeMethod · 0.45

Tested by

no test coverage detected