diff --git a/Tests/test_file_fpx.py b/Tests/test_file_fpx.py index a7c2f0c3bc5..441a3e635b3 100644 --- a/Tests/test_file_fpx.py +++ b/Tests/test_file_fpx.py @@ -1,8 +1,14 @@ from helper import unittest, PillowTestCase -from PIL import FpxImagePlugin +try: + from PIL import FpxImagePlugin +except ImportError: + olefile_installed = False +else: + olefile_installed = True +@unittest.skipUnless(olefile_installed, "olefile package not installed") class TestFileFpx(PillowTestCase): def test_invalid_file(self): diff --git a/Tests/test_file_mic.py b/Tests/test_file_mic.py index 44be9a4752b..fb37a5caa5c 100644 --- a/Tests/test_file_mic.py +++ b/Tests/test_file_mic.py @@ -1,10 +1,18 @@ from helper import unittest, PillowTestCase, hopper -from PIL import Image, ImagePalette, MicImagePlugin +from PIL import Image, ImagePalette + +try: + from PIL import MicImagePlugin +except ImportError: + olefile_installed = False +else: + olefile_installed = True TEST_FILE = "Tests/images/hopper.mic" +@unittest.skipUnless(olefile_installed, "olefile package not installed") class TestFileMic(PillowTestCase): def test_sanity(self): diff --git a/requirements.txt b/requirements.txt index 4a946a64ccf..40985400e64 100644 --- a/requirements.txt +++ b/requirements.txt @@ -15,6 +15,7 @@ docutils jarn.viewdoc nose-cov nose +olefile pep8 pyflakes pyroma diff --git a/setup.py b/setup.py index 4948faf1a70..487e8d6bab3 100755 --- a/setup.py +++ b/setup.py @@ -780,7 +780,6 @@ def debug_build(): include_package_data=True, packages=find_packages(), scripts=glob.glob("Scripts/*.py"), - install_requires=['olefile'], test_suite='nose.collector', keywords=["Imaging", ], license='Standard PIL License', @@ -806,4 +805,3 @@ def debug_build(): """ % (str(err), str(err)) sys.stderr.write(msg) raise DependencyException(msg) -