MCPcopy Index your code
hub / github.com/python/cpython / getvalue

Method getvalue

Lib/doctest.py:278–285  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

276# Override some StringIO methods.
277class _SpoofOut(StringIO):
278 def getvalue(self):
279 result = StringIO.getvalue(self)
280 # If anything at all was written, make sure there's a trailing
281 # newline. There's no way for the expected output to indicate
282 # that a trailing newline is missing.
283 if result and not result.endswith("\n"):
284 result += "\n"
285 return result
286
287 def truncate(self, size=None):
288 self.seek(size)

Callers 1

__runMethod · 0.45

Calls 1

endswithMethod · 0.45

Tested by

no test coverage detected