mirror of
				https://github.com/python-pillow/Pillow.git
				synced 2025-10-31 16:07:30 +03:00 
			
		
		
		
	assert_exception is assertRaises
This commit is contained in:
		
							parent
							
								
									d385dd81a7
								
							
						
					
					
						commit
						133120c6a6
					
				|  | @ -30,13 +30,13 @@ script: | |||
| 
 | ||||
|     # Don't cover PyPy: it fails intermittently and is x5.8 slower (#640) | ||||
|   - if [ "$TRAVIS_PYTHON_VERSION" == "pypy" ]; then python selftest.py; fi | ||||
|   - if [ "$TRAVIS_PYTHON_VERSION" == "pypy" ]; then python Tests/run.py; fi | ||||
|   - if [ "$TRAVIS_PYTHON_VERSION" == "pypy" ]; then nosetests test/; fi | ||||
|   - if [ "$TRAVIS_PYTHON_VERSION" == "pypy" ]; then python Tests/run.py; fi | ||||
| 
 | ||||
|     # Cover the others | ||||
|   - if [ "$TRAVIS_PYTHON_VERSION" != "pypy" ]; then coverage run --append --include=PIL/* selftest.py; fi | ||||
|   - if [ "$TRAVIS_PYTHON_VERSION" != "pypy" ]; then python Tests/run.py --coverage; fi | ||||
|   - if [ "$TRAVIS_PYTHON_VERSION" != "pypy" ]; then coverage run --append --include=PIL/* -m nose test/; fi | ||||
|   - if [ "$TRAVIS_PYTHON_VERSION" != "pypy" ]; then python Tests/run.py --coverage; fi | ||||
| 
 | ||||
| 
 | ||||
| after_success: | ||||
|  |  | |||
|  | @ -18,8 +18,8 @@ class TestImageLoad(PillowTestCase): | |||
|     def test_close(self): | ||||
|         im = Image.open("Images/lena.gif") | ||||
|         im.close() | ||||
|         self.assert_exception(ValueError, lambda: im.load()) | ||||
|         self.assert_exception(ValueError, lambda: im.getpixel((0, 0))) | ||||
|         self.assertRaises(ValueError, lambda: im.load()) | ||||
|         self.assertRaises(ValueError, lambda: im.getpixel((0, 0))) | ||||
| 
 | ||||
|     def test_contextmanager(self): | ||||
|         fn = None | ||||
|  | @ -27,7 +27,7 @@ class TestImageLoad(PillowTestCase): | |||
|             fn = im.fp.fileno() | ||||
|             os.fstat(fn) | ||||
| 
 | ||||
|         self.assert_exception(OSError, lambda: os.fstat(fn)) | ||||
|         self.assertRaises(OSError, lambda: os.fstat(fn)) | ||||
| 
 | ||||
| if __name__ == '__main__': | ||||
|     unittest.main() | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	Block a user