-
Notifications
You must be signed in to change notification settings - Fork 7.1k
Closed
Labels
Description
Currently some of the tests in test_image.py
write inside the assets folder. Example:
Lines 113 to 125 in 78159d6
def test_write_jpeg(self): | |
for img_path in get_images(IMAGE_ROOT, ".jpg"): | |
data = read_file(img_path) | |
img = decode_jpeg(data) | |
basedir = os.path.dirname(img_path) | |
filename, _ = os.path.splitext(os.path.basename(img_path)) | |
torch_jpeg = os.path.join( | |
basedir, '{0}_torch.jpg'.format(filename)) | |
pil_jpeg = os.path.join( | |
basedir, 'jpeg_write', '{0}_pil.jpg'.format(filename)) | |
write_jpeg(img, torch_jpeg, quality=75) |
As per discussion here, all tests that write to files should write to temporary locations via tempfile or similar solutions. It's worth ensuring that the solution works seamlessly on Windows.