You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@iceberg.apache.org by GitBox <gi...@apache.org> on 2023/01/17 08:08:29 UTC

[GitHub] [iceberg] arminnajafi commented on pull request #6445: Python: Mock home and root folder when running `test_missing_uri`

arminnajafi commented on PR #6445:
URL: https://github.com/apache/iceberg/pull/6445#issuecomment-1384992306

   I don't think this change is not cutting it.
   
   I think it because before we get to the patch line:
   ```
   # mock to prevent parsing ~/.pyiceberg.yaml or {PYICEBERG_HOME}/.pyiceberg.yaml
   with mock.patch.dict(os.environ, {"HOME": empty_home_dir_path, "PYICEBERG_HOME": empty_home_dir_path}):
   ``` 
   
   Config is already loaded by the one of imports statements in the `test_console.py` file and below code already runs and read the real $HOME env.:
   
   https://github.com/apache/iceberg/blob/596d7b876dcd9a9d5a5242622e3abaf8f069f3dc/python/pyiceberg/catalog/__init__.py#L51
   
   
   `make test` fails for me with:
   
   ```
   tests/cli/test_console.py:144: AssertionError
   
   ...
   
   E           AssertionError: assert 'You must specify a region.\n' == 'URI missing,...EFAULT__URI\n'
   E             + You must specify a region.
   E             - URI missing, please provide using --uri, the config or environment variable 
   E             - PYICEBERG_CATALOG__DEFAULT__URI
   ```
   
   
   
   ```
   > cat ~/.pyiceberg.yaml 
   catalog:
     default:
       type: glue
   ```
   


-- 
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: issues-unsubscribe@iceberg.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@iceberg.apache.org
For additional commands, e-mail: issues-help@iceberg.apache.org