(self)
| 403 | self.assertEqual(f.read(), "helLO\n") |
| 404 | |
| 405 | def testDecorator(self): |
| 406 | splootFile = splootFromPython(''' |
| 407 | def do_twice(func): |
| 408 | def inner(): |
| 409 | func() |
| 410 | func() |
| 411 | return inner |
| 412 | |
| 413 | @do_twice |
| 414 | def say_hello(): |
| 415 | print("hello") |
| 416 | |
| 417 | say_hello() |
| 418 | ''') |
| 419 | |
| 420 | f = io.StringIO() |
| 421 | f.write = wrapStdout(f.write) |
| 422 | with contextlib.redirect_stdout(f): |
| 423 | executePythonFile(splootFile) |
| 424 | |
| 425 | f.seek(0) |
| 426 | self.assertEqual(f.read(), "hello\nhello\n") |
| 427 | |
| 428 | |
| 429 |
nothing calls this directly
no test coverage detected