'Ref #383. Python 3.3\'s namespace package messed with our import hooks
Importing a module that didn\'t exist, even if the ImportError was
gracefully handled, would make our test crash.
Use recwarn here to silence this warning in Python 2.6 and 2.7:
ImportWarning: Not importing directory \'...
ot_a_package\': missing __init__.py'

@pytest.mark.usefixtures('recwarn')
def test_namespace_import_doesnt_confuse_import_hook(self, testdir):

    testdir.mkdir('not_a_package')
    p = testdir.makepyfile('\n                                                try:\n                                                                from    not_a_package    import    doesnt_exist\n                                                except    ImportError:\n                                                                #    We    handle    the    import    error    gracefully    here\n                                                                pass\n\n                                                def    test_whatever():\n                                                                pass\n                                ')
    res = testdir.runpytest(p.basename)
    assert (res.ret == 0)
