Skip to content
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

Windows compatibility: unit test about configuration fail #350

Closed
JohanKJSchreurs opened this issue Dec 15, 2022 · 2 comments
Closed

Windows compatibility: unit test about configuration fail #350

JohanKJSchreurs opened this issue Dec 15, 2022 · 2 comments
Assignees

Comments

@JohanKJSchreurs
Copy link
Contributor

JohanKJSchreurs commented Dec 15, 2022

Some unit tests fail on Windows. They seem to be related to configuration files and where they are located.

At first sight, the tests seem to make some assumptions, such as some default paths and that the path separator is / .
So it might just be that for these 3 tests, it it is only the test that needs to be fixed.

This is the test summary:

============================================================= short test summary info =============================================================
FAILED tests/test_config.py::test_get_user_config_dir - AssertionError: assert WindowsPath('C:/Users/testuser/AppData/Roaming/openeo-python-client') == (WindowsPath('C:/dev-projects/VITO/codebases/ope...
FAILED tests/test_config.py::test_get_user_data_dir - AssertionError: assert WindowsPath('C:/Users/testuser/AppData/Roaming/openeo-python-client') == (WindowsPath('C:/dev-projects/VITO/codebases/ope...
FAILED tests/rest/auth/test_cli.py::test_paths - AssertionError: assert '/auth-config.json' in 'openEO auth config: C:\\Users\\testuser\\AppData\\Local\\Temp\\pytest-of-testuser\\pytest-52\\test...
============================================ 3 failed, 1260 passed, 17 skipped, 179 warnings in 55.49s ============================================
@soxofaan
Copy link
Member

FYI: this bit of conftest is probably important here:

# Make tests more predictable and avoid loading real configs in tests.
os.environ["XDG_CONFIG_HOME"] = str(Path(__file__).parent / "data/user_dirs/config")
os.environ["XDG_DATA_HOME"] = str(Path(__file__).parent / "data/user_dirs/data")

it sets up some "home dir" related env vars that probably only work on linux

@soxofaan
Copy link
Member

soxofaan commented Jan 4, 2023

PR #354 was merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants