Fokko commented on code in PR #4811:
URL: https://github.com/apache/iceberg/pull/4811#discussion_r876887844
##########
python/tests/io/test_pyarrow.py:
##########
@@ -180,20 +180,6 @@ def test_raise_on_creating_a_local_file_no_permission():
assert "Cannot get file info, access denied:" in str(exc_info.value)
-def test_raise_on_checking_if_local_file_exists_no_permission():
- """Test that a PyArrowFile raises when deleting a local file without
permission"""
-
- with tempfile.TemporaryDirectory() as tmpdirname:
- os.chmod(tmpdirname, 0o600)
- file_location = os.path.join(tmpdirname, "foo.txt")
- file_io = PyArrowFileIO()
-
- with pytest.raises(PermissionError) as exc_info:
- file_io.delete(file_location)
-
- assert "Cannot delete file" in str(exc_info.value)
Review Comment:
Because mypy detected that this test was in there twice:
```
➜ python git:(fd-move-to-pre-commit) ✗ pre-commit run --all-files
trim trailing
whitespace.................................................Passed
fix end of
files.........................................................Passed
check docstring is
first.................................................Passed
debug statements
(python)................................................Passed
check
yaml...............................................................Passed
check python
ast.........................................................Passed
black....................................................................Passed
isort....................................................................Passed
mypy.....................................................................Failed
- hook id: mypy
- exit code: 1
python/tests/io/test_pyarrow.py:182: error: Name
"test_raise_on_checking_if_local_file_exists_no_permission" already defined on
line 154
Found 1 error in 1 file (checked 35 source files)
pycln....................................................................Passed
```
I think this test was copied a couple of times, to create different
permutations of the original test, but it looks like they are identical:
https://github.com/apache/iceberg/blob/bb08b0492a1fde898560d668edd24cb49d2b3cc2/python/tests/io/test_pyarrow.py#L155-L166
https://github.com/apache/iceberg/blob/bb08b0492a1fde898560d668edd24cb49d2b3cc2/python/tests/io/test_pyarrow.py#L183-L194
Now posting the tests here, I see that there are slight differences :))))
I'll rename the tests accordingly.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]