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

Normalized paths in test_commons.py to make tests platform-independent #1350

Merged
merged 1 commit into from
Sep 30, 2024

Conversation

kremnik
Copy link
Contributor

@kremnik kremnik commented Sep 29, 2024

Tickets

#1337

What has been done

With this PR, paths processing in test_commons.py was added. Due to direct path comparisons in test_commons.py without considering the OS, the tests were failing on Windows (an example is shown below). This change adds path normalization using os.path.normpath to make the paths platform-independent.

Example of the error in Windows 10:

AssertionError: expected call not found.
Expected: download('http://example.com/model_weights.bz2', '/mock/home/.deepface/weights/model_weights.h5.bz2', quiet=False)
Actual: download('http://example.com/model_weights.bz2', '/mock/home\\.deepface/weights\\model_weights.h5.bz2', quiet=False)

How to test

cd tests && python -m pytest test_commons.py -s --disable-warnings

@serengil
Copy link
Owner

LGTM

@serengil serengil merged commit 1475aa8 into serengil:master Sep 30, 2024
2 checks passed
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

Successfully merging this pull request may close these issues.

2 participants