-
Notifications
You must be signed in to change notification settings - Fork 239
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
chore(tests): do not use hard-coded paths in tests #1834
Conversation
a0166d4
to
1e9be73
Compare
@henryiii, would you mind reviewing this one ? I don't mind waiting for pyodide PR to land first but I'd rather have it the other way around though (and I'm willing to fix conflicts there if it helps). |
test/test_before_build.py
Outdated
|
||
# TODO: This is not valid in an virtual environment | ||
assert stored_path == current_path, '{0} != {1}'.format(stored_path, current_path) | ||
assert os.stat(stored_prefix) == os.stat(sys.prefix) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not os.path.samefile?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is also at least one more existing os.stat compare that would read better this way, imo. But could be a follow up because this matches the existing one(s).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This check was already used in test_before_test.py so I reused it here.
I will change them for samefile which seems better suited.
use `os.path.samefile` rather than comparing `os.stat` directly.
This would help reduce the amount of specific code for pyodide in #1456