New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Failed test_get_package_tuple_compiled: AttributeError: module 'zlib' has no attribute '__file__' #495
Comments
Thanks for writing this bug report this @hosiet. I was not really quite sure what really caused it, running the test on Linux/Ubuntu in Github Actions seems to be fine, but I can see this error on my local machine which is also using Ubuntu. I thought it was something quirky about my local setup but seems that I'm not the only one that sees this error, this means it might be something more widespread. I think the reason for this error is because |
The intention of the test seems to check that the autoimporter can get the info of a package with @pytest.fixture
def zlib_package():
if "zlib" in sys.builtin_module_names:
return Package("zlib", Source.BUILTIN, None, PackageType.BUILTIN)
else:
import zlib
return Package(
"zlib", Source.STANDARD, pathlib.Path(zlib.__file__), PackageType.COMPILED
)
@pytest.mark.skipif(platform == "win32", reason="Windows doesn't have compiled modules")
def test_get_package_tuple_compiled(zlib_package):
assert utils.get_package_tuple(zlib_path) == zlib_package |
…oimport-test Fixes #495 test failing due to `zlib` not being compiled in some systems
Describe the bug
When building
rope
package, testtest_get_package_tuple_compiled
fails on my system due to unrelated error (assertion onzlib
module).To Reproduce
After cloning the GitHub project, execute the following commands in the source dir:
The following error will occur:
I am not sure why the test assumes that
zlib.__file__
should exist:Editor information (please complete the following information):
The text was updated successfully, but these errors were encountered: