test_eval.py 516 Bytes
Newer Older
1
# -*- coding: utf-8 -*-
2
import os
Isuru Fernando's avatar
Isuru Fernando committed
3
import pytest
4
from pybind11_tests import eval_ as m
Dean Moldovan's avatar
Dean Moldovan committed
5
6


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

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

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


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

23
    assert m.test_eval_file_failure()