mirror of
				https://github.com/python-pillow/Pillow.git
				synced 2025-10-31 16:07:30 +03:00 
			
		
		
		
	Merge pull request #2475 from wiredfool/pr_2032
Added non-exclusive fd for test for #2330
This commit is contained in:
		
						commit
						9207d71f30
					
				|  | @ -469,8 +469,8 @@ class TestFileTiff(PillowTestCase): | |||
| 
 | ||||
|         self.assertEqual(b'Dummy value', reloaded.info['icc_profile']) | ||||
| 
 | ||||
|     def test_close_on_load(self): | ||||
|         # same as test_fd_leak, but runs on unixlike os | ||||
|     def test_close_on_load_exclusive(self): | ||||
|         # similar to test_fd_leak, but runs on unixlike os | ||||
|         tmpfile = self.tempfile("temp.tif") | ||||
| 
 | ||||
|         with Image.open("Tests/images/uint16_1_4660.tif") as im: | ||||
|  | @ -482,6 +482,19 @@ class TestFileTiff(PillowTestCase): | |||
|         im.load() | ||||
|         self.assertTrue(fp.closed) | ||||
| 
 | ||||
|     def test_close_on_load_nonexclusive(self): | ||||
|         tmpfile = self.tempfile("temp.tif") | ||||
|          | ||||
|         with Image.open("Tests/images/uint16_1_4660.tif") as im: | ||||
|             im.save(tmpfile) | ||||
| 
 | ||||
|         f = open(tmpfile, 'rb') | ||||
|         im = Image.open(f) | ||||
|         fp = im.fp | ||||
|         self.assertFalse(fp.closed) | ||||
|         im.load() | ||||
|         self.assertFalse(fp.closed) | ||||
| 
 | ||||
|          | ||||
| 
 | ||||
| @unittest.skipUnless(sys.platform.startswith('win32'), "Windows only") | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	Block a user