Removed top-level tests directory. Test config now in celery.tests.config

This means running the unittests doesn't require any special setup.
celery/tests/__init__ now configures the CELERY_CONFIG_MODULE and
CELERY_LOADER, so when nosetests imports that, the unit test environment
is all set up.
This commit is contained in:
Ask Solem 2010-06-11 12:04:53 +02:00
Родитель 9c54c7a19f
Коммит 994faa8961
5 изменённых файлов: 12 добавлений и 12 удалений

Просмотреть файл

@ -11,7 +11,6 @@ include setup.cfg
recursive-include bin *
recursive-include celery *.py
recursive-include docs *
recursive-include tests *
recursive-include contrib *
recursive-include examples *
prune tests/*.pyc

Просмотреть файл

@ -0,0 +1,7 @@
import os
config = os.environ.setdefault("CELERY_TEST_CONFIG_MODULE",
"celery.tests.config")
os.environ["CELERY_CONFIG_MODULE"] = config
os.environ["CELERY_LOADER"] = "default"

Просмотреть файл

Просмотреть файл

@ -98,7 +98,7 @@ def bump(options):
("verbose", "V", "Make more noise"),
])
def test(options):
cmd = "CELERY_LOADER=default PYTHONPATH=tests nosetests"
cmd = "CELERY_LOADER=default nosetests"
if getattr(options, "coverage", False):
cmd += " --with-coverage3"
if getattr(options, "quick", False):

Просмотреть файл

@ -17,21 +17,15 @@ except ImportError:
import celery as distmeta
class RunTests(TestCommand):
env = dict(CELERY_LOADER="default",
CELERY_CONFIG_MODULE="tests.celeryconfig",
CELERYINIT=1)
extra_env = {}
class QuickRunTests(TestCommand):
extra_env = dict(SKIP_RLIMITS=1, QUICKTEST=1)
def run(self, *args, **kwargs):
for env_name, env_value in dict(self.env, **self.extra_env).items():
for env_name, env_value in self.extra_env.items():
os.environ[env_name] = str(env_value)
TestCommand.run(self, *args, **kwargs)
class QuickRunTests(RunTests):
extra_env = dict(SKIP_RLIMITS=1, QUICKTEST=1)
install_requires = []
try:
@ -75,7 +69,7 @@ setup(
zip_safe=False,
install_requires=install_requires,
tests_require=['nose-cover3', 'unittest2', 'simplejson'],
cmdclass = {"test": RunTests, "quicktest": QuickRunTests},
cmdclass = {"quicktest": QuickRunTests},
test_suite="nose.collector",
classifiers=[
"Development Status :: 5 - Production/Stable",