Browse Source

testproj renamed to tests, and celery/tests moved to tests/testunits (and so
tests are no longer installed into site packages)

Ask Solem 15 năm trước cách đây
mục cha
commit
99bb1f1805
54 tập tin đã thay đổi với 26 bổ sung20 xóa
  1. 1 1
      setup.py
  2. 0 0
      tests/__init__.py
  3. 0 0
      tests/manage.py
  4. 1 1
      tests/settings.py
  5. 0 0
      tests/someapp/__init__.py
  6. 0 0
      tests/someapp/models.py
  7. 0 0
      tests/someapp/tasks.py
  8. 0 0
      tests/someapp/views.py
  9. 0 0
      tests/someappwotask/__init__.py
  10. 0 0
      tests/someappwotask/models.py
  11. 0 0
      tests/someappwotask/views.py
  12. 0 0
      tests/testunits/__init__.py
  13. 0 0
      tests/testunits/compat.py
  14. 0 0
      tests/testunits/runners.py
  15. 0 0
      tests/testunits/test_backends/__init__.py
  16. 0 0
      tests/testunits/test_backends/test_amqp.py
  17. 0 0
      tests/testunits/test_backends/test_base.py
  18. 0 0
      tests/testunits/test_backends/test_cache.py
  19. 0 0
      tests/testunits/test_backends/test_database.py
  20. 2 2
      tests/testunits/test_backends/test_redis.py
  21. 0 0
      tests/testunits/test_backends/test_tyrant.py
  22. 0 0
      tests/testunits/test_beat.py
  23. 0 0
      tests/testunits/test_bin_celeryd.py
  24. 2 1
      tests/testunits/test_buckets.py
  25. 0 0
      tests/testunits/test_celery.py
  26. 0 0
      tests/testunits/test_conf.py
  27. 0 0
      tests/testunits/test_datastructures.py
  28. 0 0
      tests/testunits/test_discovery.py
  29. 0 0
      tests/testunits/test_events.py
  30. 2 1
      tests/testunits/test_loaders.py
  31. 2 2
      tests/testunits/test_log.py
  32. 0 0
      tests/testunits/test_messaging.py
  33. 0 0
      tests/testunits/test_models.py
  34. 0 0
      tests/testunits/test_pickle.py
  35. 0 0
      tests/testunits/test_pool.py
  36. 0 0
      tests/testunits/test_registry.py
  37. 3 1
      tests/testunits/test_result.py
  38. 1 2
      tests/testunits/test_serialization.py
  39. 1 1
      tests/testunits/test_task.py
  40. 0 0
      tests/testunits/test_task_builtins.py
  41. 0 0
      tests/testunits/test_task_control.py
  42. 3 2
      tests/testunits/test_task_http.py
  43. 2 2
      tests/testunits/test_utils.py
  44. 0 0
      tests/testunits/test_utils_info.py
  45. 0 0
      tests/testunits/test_views.py
  46. 3 2
      tests/testunits/test_worker.py
  47. 0 0
      tests/testunits/test_worker_control.py
  48. 0 0
      tests/testunits/test_worker_controllers.py
  49. 0 0
      tests/testunits/test_worker_heartbeat.py
  50. 3 2
      tests/testunits/test_worker_job.py
  51. 0 0
      tests/testunits/test_worker_revoke.py
  52. 0 0
      tests/testunits/test_worker_scheduler.py
  53. 0 0
      tests/testunits/utils.py
  54. 0 0
      tests/urls.py

+ 1 - 1
setup.py

@@ -100,7 +100,7 @@ setup(
     url=distmeta.__homepage__,
     platforms=["any"],
     license="BSD",
-    packages=find_packages(exclude=['ez_setup', 'testproj', 'testproj.*']),
+    packages=find_packages(exclude=['ez_setup', 'tests', 'tests.*']),
     scripts=["bin/celeryd", "bin/celeryinit", "bin/celerybeat"],
     zip_safe=False,
     install_requires=install_requires,

+ 0 - 0
testproj/__init__.py → tests/__init__.py


+ 0 - 0
testproj/manage.py → tests/manage.py


+ 1 - 1
testproj/settings.py → tests/settings.py

@@ -33,7 +33,7 @@ COVERAGE_EXCLUDE_MODULES = ("celery.__init__",
                             "celery.backends.tyrant", # FIXME
 )
 
-NOSE_ARGS = [os.path.join(here, os.pardir, "celery", "tests"),
+NOSE_ARGS = [here,
             "--cover3-package=celery",
             "--cover3-branch",
             "--cover3-exclude=%s" % ",".join(COVERAGE_EXCLUDE_MODULES)]

+ 0 - 0
testproj/someapp/__init__.py → tests/someapp/__init__.py


+ 0 - 0
testproj/someapp/models.py → tests/someapp/models.py


+ 0 - 0
testproj/someapp/tasks.py → tests/someapp/tasks.py


+ 0 - 0
testproj/someapp/views.py → tests/someapp/views.py


+ 0 - 0
testproj/someappwotask/__init__.py → tests/someappwotask/__init__.py


+ 0 - 0
testproj/someappwotask/models.py → tests/someappwotask/models.py


+ 0 - 0
testproj/someappwotask/views.py → tests/someappwotask/views.py


+ 0 - 0
celery/tests/__init__.py → tests/testunits/__init__.py


+ 0 - 0
celery/tests/compat.py → tests/testunits/compat.py


+ 0 - 0
celery/tests/runners.py → tests/testunits/runners.py


+ 0 - 0
celery/tests/test_backends/__init__.py → tests/testunits/test_backends/__init__.py


+ 0 - 0
celery/tests/test_backends/test_amqp.py → tests/testunits/test_backends/test_amqp.py


+ 0 - 0
celery/tests/test_backends/test_base.py → tests/testunits/test_backends/test_base.py


+ 0 - 0
celery/tests/test_backends/test_cache.py → tests/testunits/test_backends/test_cache.py


+ 0 - 0
celery/tests/test_backends/test_database.py → tests/testunits/test_backends/test_database.py


+ 2 - 2
celery/tests/test_backends/test_redis.py → tests/testunits/test_backends/test_redis.py

@@ -7,10 +7,11 @@ from django.core.exceptions import ImproperlyConfigured
 
 from celery import states
 from celery.utils import gen_unique_id
-from celery.tests.utils import execute_context
 from celery.backends import pyredis
 from celery.backends.pyredis import RedisBackend
 
+from testunits.utils import execute_context, mask_modules
+
 _no_redis_msg = "* Redis %s. Will not execute related tests."
 _no_redis_msg_emitted = False
 
@@ -135,7 +136,6 @@ class TestRedisBackend(unittest.TestCase):
 class TestTyrantBackendNoTyrant(unittest.TestCase):
 
     def test_tyrant_None_if_tyrant_not_installed(self):
-        from celery.tests.utils import mask_modules
         prev = sys.modules.pop("celery.backends.pyredis")
         try:
             def with_redis_masked(_val):

+ 0 - 0
celery/tests/test_backends/test_tyrant.py → tests/testunits/test_backends/test_tyrant.py


+ 0 - 0
celery/tests/test_beat.py → tests/testunits/test_beat.py


+ 0 - 0
celery/tests/test_bin_celeryd.py → tests/testunits/test_bin_celeryd.py


+ 2 - 1
celery/tests/test_buckets.py → tests/testunits/test_buckets.py

@@ -10,10 +10,11 @@ from billiard.utils.functional import curry
 
 from celery.task.base import Task
 from celery.utils import gen_unique_id
-from celery.tests.utils import skip_if_environ
 from celery.worker import buckets
 from celery.registry import TaskRegistry
 
+from testunits.utils import skip_if_environ
+
 skip_if_disabled = curry(skip_if_environ("SKIP_RLIMITS"))
 
 

+ 0 - 0
celery/tests/test_celery.py → tests/testunits/test_celery.py


+ 0 - 0
celery/tests/test_conf.py → tests/testunits/test_conf.py


+ 0 - 0
celery/tests/test_datastructures.py → tests/testunits/test_datastructures.py


+ 0 - 0
celery/tests/test_discovery.py → tests/testunits/test_discovery.py


+ 0 - 0
celery/tests/test_events.py → tests/testunits/test_events.py


+ 2 - 1
celery/tests/test_loaders.py → tests/testunits/test_loaders.py

@@ -8,7 +8,8 @@ from celery import loaders
 from celery.loaders import base
 from celery.loaders import djangoapp
 from celery.loaders import default
-from celery.tests.utils import with_environ
+
+from testunits.utils import with_environ
 
 
 class TestLoaders(unittest.TestCase):

+ 2 - 2
celery/tests/test_log.py → tests/testunits/test_log.py

@@ -10,13 +10,13 @@ from StringIO import StringIO
 try:
     from contextlib import contextmanager
 except ImportError:
-    from celery.tests.utils import fallback_contextmanager as contextmanager
+    from testunits.utils import fallback_contextmanager as contextmanager
 
 from carrot.utils import rpartition
 
 from celery.log import (setup_logger, emergency_error,
                         redirect_stdouts_to_logger, LoggingProxy)
-from celery.tests.utils import override_stdouts, execute_context
+from testunits.utils import override_stdouts, execute_context
 
 
 @contextmanager

+ 0 - 0
celery/tests/test_messaging.py → tests/testunits/test_messaging.py


+ 0 - 0
celery/tests/test_models.py → tests/testunits/test_models.py


+ 0 - 0
celery/tests/test_pickle.py → tests/testunits/test_pickle.py


+ 0 - 0
celery/tests/test_pool.py → tests/testunits/test_pool.py


+ 0 - 0
celery/tests/test_registry.py → tests/testunits/test_registry.py


+ 3 - 1
celery/tests/test_result.py → tests/testunits/test_result.py

@@ -1,14 +1,16 @@
 from __future__ import generators
+
 import unittest
 
 from celery import states
 from celery.utils import gen_unique_id
-from celery.tests.utils import skip_if_quick
 from celery.result import AsyncResult, TaskSetResult
 from celery.backends import default_backend
 from celery.exceptions import TimeoutError
 from celery.task.base import Task
 
+from testunits.utils import skip_if_quick
+
 
 def mock_task(name, status, result):
     return dict(id=gen_unique_id(), name=name, status=status, result=result)

+ 1 - 2
celery/tests/test_serialization.py → tests/testunits/test_serialization.py

@@ -1,13 +1,12 @@
 import sys
 import unittest
 
-from celery.tests.utils import execute_context
+from testunits.utils import execute_context, mask_modules
 
 
 class TestAAPickle(unittest.TestCase):
 
     def test_no_cpickle(self):
-        from celery.tests.utils import mask_modules
         prev = sys.modules.pop("billiard.serialization")
         try:
             def with_cPickle_masked(_val):

+ 1 - 1
celery/tests/test_task.py → tests/testunits/test_task.py

@@ -264,7 +264,7 @@ class TestCeleryTasks(unittest.TestCase):
 
         # task name generated out of class module + name.
         T2 = self.createTaskCls("T2")
-        self.assertEquals(T2().name, "celery.tests.test_task.T2")
+        self.assertTrue(T2().name.endswith("test_task.T2"))
 
         t1 = T1()
         consumer = t1.get_consumer()

+ 0 - 0
celery/tests/test_task_builtins.py → tests/testunits/test_task_builtins.py


+ 0 - 0
celery/tests/test_task_control.py → tests/testunits/test_task_control.py


+ 3 - 2
celery/tests/test_task_http.py → tests/testunits/test_task_http.py

@@ -8,7 +8,7 @@ from urllib import addinfourl
 try:
     from contextlib import contextmanager
 except ImportError:
-    from celery.tests.utils import fallback_contextmanager as contextmanager
+    from testunits.utils import fallback_contextmanager as contextmanager
 try:
     from cStringIO import StringIO
 except ImportError:
@@ -18,7 +18,8 @@ from billiard.utils.functional import wraps
 from anyjson import serialize
 
 from celery.task import http
-from celery.tests.utils import eager_tasks, execute_context
+
+from testunits.utils import eager_tasks, execute_context
 
 
 @contextmanager

+ 2 - 2
celery/tests/test_utils.py → tests/testunits/test_utils.py

@@ -5,8 +5,9 @@ import unittest
 from billiard.utils.functional import wraps
 
 from celery import utils
-from celery.tests.utils import sleepdeprived, execute_context
 
+from testunits.utils import sleepdeprived, execute_context
+from testunits.utils import mask_modules
 
 class TestChunks(unittest.TestCase):
 
@@ -31,7 +32,6 @@ class TestChunks(unittest.TestCase):
 class TestGenUniqueId(unittest.TestCase):
 
     def test_gen_unique_id_without_ctypes(self):
-        from celery.tests.utils import mask_modules
         old_utils = sys.modules.pop("celery.utils")
 
         def with_ctypes_masked(_val):

+ 0 - 0
celery/tests/test_utils_info.py → tests/testunits/test_utils_info.py


+ 0 - 0
celery/tests/test_views.py → tests/testunits/test_views.py


+ 3 - 2
celery/tests/test_worker.py → tests/testunits/test_worker.py

@@ -9,8 +9,6 @@ from billiard.serialization import pickle
 
 from celery import conf
 from celery.utils import gen_unique_id, noop
-from celery.tests.utils import execute_context
-from celery.tests.compat import catch_warnings
 from celery.worker import WorkController
 from celery.worker.listener import CarrotListener, RUN, CLOSE
 from celery.worker.job import TaskWrapper
@@ -18,6 +16,9 @@ from celery.worker.scheduler import Scheduler
 from celery.decorators import task as task_dec
 from celery.decorators import periodic_task as periodic_task_dec
 
+from testunits.utils import execute_context
+from testunits.compat import catch_warnings
+
 
 class PlaceHolder(object):
         pass

+ 0 - 0
celery/tests/test_worker_control.py → tests/testunits/test_worker_control.py


+ 0 - 0
celery/tests/test_worker_controllers.py → tests/testunits/test_worker_controllers.py


+ 0 - 0
celery/tests/test_worker_heartbeat.py → tests/testunits/test_worker_heartbeat.py


+ 3 - 2
celery/tests/test_worker_job.py → tests/testunits/test_worker_job.py

@@ -12,8 +12,6 @@ from celery import states
 from celery.log import setup_logger
 from celery.task.base import Task
 from celery.utils import gen_unique_id
-from celery.tests.utils import execute_context
-from celery.tests.compat import catch_warnings
 from celery.models import TaskMeta
 from celery.result import AsyncResult
 from celery.worker.job import WorkerTaskTrace, TaskWrapper
@@ -22,6 +20,9 @@ from celery.exceptions import RetryTaskError, NotRegistered
 from celery.decorators import task as task_dec
 from celery.datastructures import ExceptionInfo
 
+from testunits.utils import execute_context
+from testunits.compat import catch_warnings
+
 scratch = {"ACK": False}
 some_kwargs_scratchpad = {}
 

+ 0 - 0
celery/tests/test_worker_revoke.py → tests/testunits/test_worker_revoke.py


+ 0 - 0
celery/tests/test_worker_scheduler.py → tests/testunits/test_worker_scheduler.py


+ 0 - 0
celery/tests/utils.py → tests/testunits/utils.py


+ 0 - 0
testproj/urls.py → tests/urls.py