# 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 nose.tools import assert_false
from pywrap.testing import cython_extension_from
from nose.tools import assert_equal
        from fails import A
        from nodefaultctor import A
        from pythonkeywords import my_fun


def test_fails():
    with cython_extension_from("fails.hpp", assert_warn=UserWarning,
                               warn_msg="Ignoring method"):
        assert_false(hasattr(A, "my_function"))


def test_twoctors():
    with cython_extension_from("twoctors.hpp", assert_warn=UserWarning,
                               warn_msg="'A' has more than one constructor"):
        pass


def test_no_default_constructor():

# 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_errors.py
from nose.tools import assert_false
from pywrap.testing import cython_extension_from
from nose.tools import assert_equal
        from fails import A
        from nodefaultctor import A
        from pythonkeywords import my_fun



def test_fails():
    with cython_extension_from("fails.hpp", assert_warn=UserWarning,
                               warn_msg="Ignoring method"):
        assert_false(hasattr(A, "my_function"))


def test_twoctors():
    with cython_extension_from("twoctors.hpp", assert_warn=UserWarning,
                               warn_msg="'A' has more than one constructor"):
        pass


def test_no_default_constructor():

    with cython_extension_from("nodefaultctor.hpp"):