Skip to content

reset() not working in python2 #2

@shx2

Description

@shx2

Try adding this unittest to tests_pyX/test_polyloader.py.
It works fine for python3, but fails for python27 ("Failed: DID NOT RAISE")

class Test_Polymorph_Reset(object):
    def test_reset_after_import(self):
        with ImportEnvironment() as sys:
            polyloader.install(compiler("2"), ['2'])
            polyloader.install(compiler("3"), ['3'])
            from tests_py2.polytestmix.test3 import result as result3
            polyloader.reset()
            with pytest.raises(ImportError):
                from tests_py2.polytestmix.test2 import result as result2
    def test_reset_before_import(self):
        with ImportEnvironment() as sys:
            polyloader.install(compiler("3"), ['3'])
            polyloader.reset()
            with pytest.raises(ImportError):
                from tests_py2.polytestmix.test3 import result as result3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions