# 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
        from subclass import A, B
        from complexhierarchy import A, B
        from inheritancewithnamespace import ClassA, ClassB
        from inheritancefromexternal import MyString


def test_ambiguous_method():
    with cython_extension_from("subclass.hpp"):
        a = A()
        assert_equal(a.afun(), 1)
        b = B()
        assert_equal(b.afun(), 1)
        assert_equal(b.bfun(), 2)


def test_complex_hierarchy():
    with cython_extension_from("complexhierarchy.hpp"):
        a = A()
        assert_equal(a.base1_method(), 1)
        assert_equal(a.base2_method(), 2)
        assert_equal(a.a_method(), 3)
        b = B()
        assert_equal(b.base1_method(), 4)
        assert_equal(b.base2_method(), 2)
        assert_equal(b.b_method(), 5)


def test_inheritance_with_namespace():

# 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_inheritance.py
from pywrap.testing import cython_extension_from
from nose.tools import assert_equal
        from subclass import A, B
        from complexhierarchy import A, B
        from inheritancewithnamespace import ClassA, ClassB
        from inheritancefromexternal import MyString



def test_ambiguous_method():
    with cython_extension_from("subclass.hpp"):
        a = A()
        assert_equal(a.afun(), 1)
        b = B()
        assert_equal(b.afun(), 1)
        assert_equal(b.bfun(), 2)


def test_complex_hierarchy():
    with cython_extension_from("complexhierarchy.hpp"):
        a = A()
        assert_equal(a.base1_method(), 1)
        assert_equal(a.base2_method(), 2)
        assert_equal(a.a_method(), 3)
        b = B()
        assert_equal(b.base1_method(), 4)
        assert_equal(b.base2_method(), 2)
        assert_equal(b.b_method(), 5)


def test_inheritance_with_namespace():

    with cython_extension_from("inheritancewithnamespace.hpp"):