mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-28 02:04:36 +03:00
Merge pull request #706 from wiredfool/nose
Nose - run against installed pillow
This commit is contained in:
commit
6191b49b62
|
@ -18,6 +18,8 @@ class TestImageCms(PillowTestCase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
try:
|
try:
|
||||||
from PIL import ImageCms
|
from PIL import ImageCms
|
||||||
|
# need to hit getattr to trigger the delayed import error
|
||||||
|
ImageCms.core.profile_open
|
||||||
except ImportError as v:
|
except ImportError as v:
|
||||||
self.skipTest(v)
|
self.skipTest(v)
|
||||||
|
|
||||||
|
|
24
test-installed.py
Executable file
24
test-installed.py
Executable file
|
@ -0,0 +1,24 @@
|
||||||
|
#!/usr/bin/env python
|
||||||
|
import nose
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
import glob
|
||||||
|
|
||||||
|
# monkey with the path, removing the local directory but adding the Tests/ directory
|
||||||
|
# for helper.py and the other local imports there.
|
||||||
|
|
||||||
|
del(sys.path[0])
|
||||||
|
sys.path.insert(0, os.path.abspath('./Tests'))
|
||||||
|
|
||||||
|
# if there's no test selected (mostly) choose a working default.
|
||||||
|
# Something is required, because if we import the tests from the local
|
||||||
|
# directory, once again, we've got the non-installed PIL in the way
|
||||||
|
if len(sys.argv) == 1:
|
||||||
|
sys.argv.extend(glob.glob('Tests/test*.py'))
|
||||||
|
|
||||||
|
# Make sure that nose doesn't muck with our paths.
|
||||||
|
if ('--no-path-adjustment' not in sys.argv) and ('-P' not in sys.argv):
|
||||||
|
sys.argv.insert(1, '--no-path-adjustment')
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
nose.main()
|
Loading…
Reference in New Issue
Block a user