def METHOD_NAME():
    """Test module with invalid __all__
    https://github.com/ipython/ipython/issues/9678
    """
    testsdir = os.path.dirname(__file__)
    sys.path.insert(0, testsdir)
    try:
        results = module_completion("from bad_all import ")
        assert "puppies" in results
        for r in results:
            assert isinstance(r, str)
        # bad_all doesn't contain submodules, but this completion
        # should finish without raising an exception:
        results = module_completion("import bad_all.")
        assert results == []
    finally:
        sys.path.remove(testsdir)