Fixed #21122 -- Improved clean up of test temp directory on Windows #1649

Closed
wants to merge 1 commit into
from

Projects

None yet

3 participants

Contributor
marfire commented Sep 19, 2013
  • Fixed test that didn't close the files it opened
  • Catching and handling exception when temp directory cannot be removed
  • Fixed an unrelated bug that affects bisect_tests() under Python 3
    (having to do with true division always returning a float)
@charettes charettes and 1 other commented on an outdated diff Sep 19, 2013
tests/runtests.py
@@ -247,7 +255,7 @@ def bisect_tests(bisection_label, options, test_labels):
iteration = 1
while len(test_labels) > 1:
- midpoint = len(test_labels)/2
+ midpoint = int(len(test_labels) / 2)
charettes
charettes Sep 19, 2013 Member

Use // instead with a from __future__ import division import.

marfire
marfire Sep 20, 2013 Contributor

Although the results are the same in this case, I think that int() is better practice when the result must be an integer, since the return value of // depends on the operands.

charettes
charettes Sep 20, 2013 Member

IMHO len(test_labels) and 2 and quite explicit int operands in this case making it clear the return value of // will also be an int but well, I think I'm bikeshedding here.

charettes
charettes Sep 23, 2013 Member

Committed this change in ab643cd because @apollo13 also stumbled on it.

@marfire marfire Fixed #21122 -- Improved clean up of test temp directory on Windows
- Fixed test that didn't close the files it opened
- Caught and handled exception when temp directory cannot be removed
585f3d1
Contributor
marfire commented Sep 24, 2013

I removed the bisect_tests() bugfix since it was fixed in ab643cd,

Owner

merged in 978e135 - thanks!

@timgraham timgraham closed this Oct 2, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment