-
Notifications
You must be signed in to change notification settings - Fork 45
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
Make symlink optional to fix tests on Windows #1600
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1600 +/- ##
==========================================
+ Coverage 66.62% 66.64% +0.01%
==========================================
Files 614 614
Lines 68725 68763 +38
Branches 9567 9577 +10
==========================================
+ Hits 45789 45824 +35
- Misses 21007 21010 +3
Partials 1929 1929 |
and don't generate warnings
shutil.copy(image, tmp_path) | ||
yield tmp_path.joinpath("centroid_####.cbf") | ||
for image in images: | ||
(tmp_path / image.basename).unlink() |
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.
The unlink
line gave
E PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'C:\\Users\\fcx32934\\AppData\\Local\\Temp\\pytest-of-fcx32934\\pytest-67\\popen-gw9\\test_template_with_missing_ima1\\centroid_0005.cbf'
in my Windows test run.
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.
Looks like an intermittent error. Something like Windows file locking at play, perhaps
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.
fix incoming
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.
I suspect this is us not correctly dealing with file handles (ie. not using context handlers everywhere), leading to a race against the garbage collection.
This allows all tests in
test_import.py
to pass on Windows even without Administrator access, or Developer Mode.