mirror of
https://github.com/Hopiu/django-imagekit.git
synced 2026-03-16 21:30:23 +00:00
Fix setup.py test
This commit is contained in:
parent
a906555c9f
commit
f6ce251e13
2 changed files with 32 additions and 1 deletions
14
setup.py
14
setup.py
|
|
@ -1,21 +1,31 @@
|
|||
#/usr/bin/env python
|
||||
import codecs
|
||||
import os
|
||||
from setuptools import setup, find_packages
|
||||
import sys
|
||||
|
||||
from setuptools import setup, find_packages
|
||||
|
||||
# Workaround for multiprocessing/nose issue. See http://bugs.python.org/msg170215
|
||||
try:
|
||||
import multiprocessing
|
||||
except ImportError:
|
||||
pass
|
||||
|
||||
|
||||
if 'publish' in sys.argv:
|
||||
os.system('python setup.py sdist upload')
|
||||
sys.exit()
|
||||
|
||||
|
||||
read = lambda filepath: codecs.open(filepath, 'r', 'utf-8').read()
|
||||
|
||||
|
||||
# Load package meta from the pkgmeta module without loading imagekit.
|
||||
pkgmeta = {}
|
||||
execfile(os.path.join(os.path.dirname(__file__),
|
||||
'imagekit', 'pkgmeta.py'), pkgmeta)
|
||||
|
||||
|
||||
setup(
|
||||
name='django-imagekit',
|
||||
version=pkgmeta['__version__'],
|
||||
|
|
@ -35,7 +45,9 @@ setup(
|
|||
'nose==1.2.1',
|
||||
'nose-progressive==1.3',
|
||||
'django-nose==1.1',
|
||||
'PIL==1.1.7',
|
||||
],
|
||||
test_suite='testrunner.run_tests',
|
||||
install_requires=[
|
||||
'django-appconf>=0.5',
|
||||
],
|
||||
|
|
|
|||
19
testrunner.py
Normal file
19
testrunner.py
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
# A wrapper for Django's test runner.
|
||||
# See http://ericholscher.com/blog/2009/jun/29/enable-setuppy-test-your-django-apps/
|
||||
# and http://gremu.net/blog/2010/enable-setuppy-test-your-django-apps/
|
||||
import os
|
||||
import sys
|
||||
|
||||
os.environ['DJANGO_SETTINGS_MODULE'] = 'tests.settings'
|
||||
test_dir = os.path.dirname(__file__)
|
||||
sys.path.insert(0, test_dir)
|
||||
|
||||
from django.test.utils import get_runner
|
||||
from django.conf import settings
|
||||
|
||||
|
||||
def run_tests():
|
||||
cls = get_runner(settings)
|
||||
runner = cls()
|
||||
failures = runner.run_tests(['tests'])
|
||||
sys.exit(failures)
|
||||
Loading…
Reference in a new issue