Dean Moldovan | 3b44dae | 2016-08-18 16:55:26 +0200 | [diff] [blame] | 1 | import os |
Dean Moldovan | a0c1ccf | 2016-08-12 13:50:00 +0200 | [diff] [blame] | 2 | |
| 3 | |
Dean Moldovan | 3b44dae | 2016-08-18 16:55:26 +0200 | [diff] [blame] | 4 | def test_evals(capture): |
| 5 | from pybind11_tests import (test_eval_statements, test_eval, test_eval_single_statement, |
| 6 | test_eval_file, test_eval_failure, test_eval_file_failure) |
Dean Moldovan | a0c1ccf | 2016-08-12 13:50:00 +0200 | [diff] [blame] | 7 | |
| 8 | with capture: |
Dean Moldovan | 3b44dae | 2016-08-18 16:55:26 +0200 | [diff] [blame] | 9 | assert test_eval_statements() |
| 10 | assert capture == "Hello World!" |
| 11 | |
| 12 | assert test_eval() |
| 13 | assert test_eval_single_statement() |
| 14 | |
| 15 | filename = os.path.join(os.path.dirname(__file__), "test_eval_call.py") |
| 16 | assert test_eval_file(filename) |
| 17 | |
| 18 | assert test_eval_failure() |
| 19 | assert test_eval_file_failure() |