Python Instructions currently do not work for testing
See original GitHub issueApache Iceberg version
main (development)
Query engine
Other
Please describe the bug 🐞
The instructions listed in the README.md under testing
poetry install -E pyarrow
poetry run pytest
Result in an error
ImportError while loading conftest '/Users/russellspitzer/Temp/pypypy/iceberg/python/tests/conftest.py'.
tests/conftest.py:40: in <module>
import aiobotocore.awsrequest
E ModuleNotFoundError: No module named 'aiobotocore'
This is because pytest triggers all test suites and requires all optional dependencies
poetry install --all-extras
Fixes this issue but still fails some tests (tests/io/test_fsspec.py) because the S3 Mock doesn’t seem to be setup properly
FAILED tests/io/test_fsspec.py::test_fsspec_write_and_read_file - botocore.exceptions.EndpointConnectionError: Could not connect to the endpoint URL: "http://localhost:9000/warehouse/18112126-9c9a-40e3-a08a-0fb199dd4f77"
FAILED tests/io/test_fsspec.py::test_fsspec_getting_length_of_file - botocore.exceptions.EndpointConnectionError: Could not connect to the endpoint URL: "http://localhost:9000/warehouse/566507b0-e364-464f-9779-17a63329953a"
FAILED tests/io/test_fsspec.py::test_fsspec_file_tell - botocore.exceptions.EndpointConnectionError: Could not connect to the endpoint URL: "http://localhost:9000/warehouse/fdc0fd10-132b-4d00-8d04-332dfe20f516"
FAILED tests/io/test_fsspec.py::test_fsspec_read_specified_bytes_for_file - botocore.exceptions.EndpointConnectionError: Could not connect to the endpoint URL: "http://localhost:9000/warehouse/f3fc2540-1f7e-43ac-b27a-7a27a3a12216"
FAILED tests/io/test_fsspec.py::test_fsspec_raise_on_opening_file_not_found - botocore.exceptions.EndpointConnectionError: Could not connect to the endpoint URL: "http://localhost:9000/warehouse/2ce8b101-bbbc-4242-8cde-6e4e3e83516a"
FAILED tests/io/test_fsspec.py::test_checking_if_a_file_exists - botocore.exceptions.EndpointConnectionError: Could not connect to the endpoint URL: "http://localhost:9000/warehouse/does-not-exist.txt"
FAILED tests/io/test_fsspec.py::test_closing_a_file - botocore.exceptions.EndpointConnectionError: Could not connect to the endpoint URL: "http://localhost:9000/warehouse/91077182-d448-4f1f-b310-2a60d6799617"
FAILED tests/io/test_fsspec.py::test_writing_avro_file - botocore.exceptions.EndpointConnectionError: Could not connect to the endpoint URL: "http://localhost:9000/warehouse/c7aeded1-9bc6-4429-923a-d164be4f35e8"
Issue Analytics
- State:
- Created 9 months ago
- Comments:8 (8 by maintainers)
Top Results From Across the Web
Getting Started With Testing in Python
In this in-depth tutorial, you'll see how to create Python unit tests, execute them, and find the bugs before your users do. You'll...
Read more >Running and Writing Tests - Python Developer's Guide
Running : The shortest, simplest way of running the test suite is the following command from the root directory of your checkout (after...
Read more >Testing Python in Visual Studio Code
Run tests in the file that is currently in focus on the editor. Equivalent to Python: Run Current Test File on versions prior...
Read more >Testing Your Code - The Hitchhiker's Guide to Python
Always run the full test suite before a coding session, and run it again after. This will give you more confidence that you...
Read more >pytest cannot import module while python can - Stack Overflow
DO NOT put a __init__.py file in a folder containing TESTS if you plan on using pytest. I had one such file, deleting...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Great catch! I wasn’t aware of this!
The failed tests on Docker are because there is a single user in Docker. In the test, we create a file and then change the permissions in such a way that we don’t have read permissions. However, if you run it in Docker, you’re root, so the test doesn’t work. We can either introduce another user in Docker, or mock the call to the filesystem.
Both Docker containers fail btw with:
with a.o.
Is this expected?