test_eval.py 492 Bytes
Newer Older
1
import os
Isuru Fernando's avatar
Isuru Fernando committed
2
import pytest
3
from pybind11_tests import eval_ as m
Dean Moldovan's avatar
Dean Moldovan committed
4
5


6
def test_evals(capture):
Dean Moldovan's avatar
Dean Moldovan committed
7
    with capture:
8
        assert m.test_eval_statements()
9
10
    assert capture == "Hello World!"

11
12
    assert m.test_eval()
    assert m.test_eval_single_statement()
13

Isuru Fernando's avatar
Isuru Fernando committed
14
15
16
17
18
    assert m.test_eval_failure()


@pytest.unsupported_on_pypy3
def test_eval_file():
19
    filename = os.path.join(os.path.dirname(__file__), "test_eval_call.py")
20
    assert m.test_eval_file(filename)
21

22
    assert m.test_eval_file_failure()