MCPcopy Create free account
hub / github.com/SplootCode/splootcode / testReturnWithValue

Method testReturnWithValue

python/tests/test_execute.py:368–383  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

366 self.assertEqual(f.read(), 'hello\n')
367
368 def testReturnWithValue(self):
369 splootFile = splootFromPython('''
370def test():
371 return 1 + 1
372
373if test() == 2:
374 print("hello")
375''')
376
377 f = io.StringIO()
378 f.write = wrapStdout(f.write)
379 with contextlib.redirect_stdout(f):
380 executePythonFile(splootFile)
381
382 f.seek(0)
383 self.assertEqual(f.read(), 'hello\n')
384
385 def testKwargs(self):
386 splootFile = splootFromPython('''print('hello', 'there', sep="--", end="END")''')

Callers

nothing calls this directly

Calls 4

splootFromPythonFunction · 0.90
wrapStdoutFunction · 0.90
executePythonFileFunction · 0.90
readMethod · 0.80

Tested by

no test coverage detected