# Path: pywrap/testing.py
# @contextmanager
# def cython_extension_from(headers, modulename=None, config=Config(),
#                           assert_warn=None, warn_msg=None, incdirs=[],
#                           hide_errors=False, cleanup=True):
#     incdirs = full_paths(incdirs)
#     filenames = _write_cython_wrapper(full_paths(headers), modulename,
#                                       config, incdirs, assert_warn, warn_msg)
#     run_setup(SETUPPY_NAME, hide_errors)
#     try:
#         yield
#     finally:
#         if cleanup:
#             remove_files(filenames)


from pywrap.testing import cython_extension_from
from nose.tools import assert_equal, assert_not_equal
        from namespaces import ClassA, ClassB
        from constructorargs import A
        from function import fun1, fun2
        from mystruct import A, print_mystruct_a, B, print_mystruct_b
        from vectorofstruct import MyStruct, sum_of_activated_entries
        from cppoperators import Operators
        from typedef import fun
        from complexfield import A, B
        from enum import MyEnum, enum_to_string
        from enuminclass import MyEnum, enum_to_string
        from staticmethod import plus1, plus2
        assert_equal(op.v, 2)
        op *= 2
        assert_equal(op.v, 4)
        op /= 4
        assert_equal(op.v, 1)
        op %= 2
        assert_equal(op.v, 1)
        op |= True
        assert_equal(op.b, True)
        op &= True
        assert_equal(op.b, True)


def test_typedef():
    with cython_extension_from("typedef.hpp"):
        assert_equal(fun(1.0), 2.0)


def test_complex_field():
    with cython_extension_from("complexfield.hpp"):
        a = A()
        a.a = 5
        b = B()
        b.a = a
        b.b = a
        assert_equal(b.a.a, 5)
        assert_equal(b.b.a, 5)


def test_enum():

# Path: pywrap/testing.py
# @contextmanager
# def cython_extension_from(headers, modulename=None, config=Config(),
#                           assert_warn=None, warn_msg=None, incdirs=[],
#                           hide_errors=False, cleanup=True):
#     incdirs = full_paths(incdirs)
#     filenames = _write_cython_wrapper(full_paths(headers), modulename,
#                                       config, incdirs, assert_warn, warn_msg)
#     run_setup(SETUPPY_NAME, hide_errors)
#     try:
#         yield
#     finally:
#         if cleanup:
#             remove_files(filenames)


# Path: test/test_features.py
from pywrap.testing import cython_extension_from
from nose.tools import assert_equal, assert_not_equal
        from namespaces import ClassA, ClassB
        from constructorargs import A
        from function import fun1, fun2
        from mystruct import A, print_mystruct_a, B, print_mystruct_b
        from vectorofstruct import MyStruct, sum_of_activated_entries
        from cppoperators import Operators
        from typedef import fun
        from complexfield import A, B
        from enum import MyEnum, enum_to_string
        from enuminclass import MyEnum, enum_to_string
        from staticmethod import plus1, plus2

        assert_equal(op.v, 2)
        op *= 2
        assert_equal(op.v, 4)
        op /= 4
        assert_equal(op.v, 1)
        op %= 2
        assert_equal(op.v, 1)
        op |= True
        assert_equal(op.b, True)
        op &= True
        assert_equal(op.b, True)


def test_typedef():
    with cython_extension_from("typedef.hpp"):
        assert_equal(fun(1.0), 2.0)


def test_complex_field():
    with cython_extension_from("complexfield.hpp"):
        a = A()
        a.a = 5
        b = B()
        b.a = a
        b.b = a
        assert_equal(b.a.a, 5)
        assert_equal(b.b.a, 5)


def test_enum():

    with cython_extension_from("enum.hpp"):