Pārlūkot izejas kodu

New setup command: setup.py quicktest # Skip running slow tests.

Ask Solem 15 gadi atpakaļ
vecāks
revīzija
1ad3298212
2 mainītis faili ar 18 papildinājumiem un 1 dzēšanām
  1. 3 0
      Makefile
  2. 15 1
      setup.py

+ 3 - 0
Makefile

@@ -37,6 +37,9 @@ coverage:
 test:
 	(cd testproj; python manage.py test)
 
+quicktest:
+	(cd testproj; SKIP_RLIMITS=1 python manage.py test)
+
 testverbose:
 	(cd testproj; python manage.py test --verbosity=2)
 

+ 15 - 1
setup.py

@@ -27,6 +27,9 @@ class RunTests(Command):
         pass
 
     def run(self):
+        self.run_tests()
+
+    def run_tests(self):
         this_dir = os.getcwd()
         testproj_dir = os.path.join(this_dir, "testproj")
         os.chdir(testproj_dir)
@@ -40,6 +43,17 @@ class RunTests(Command):
             __file__, "test"])
         os.chdir(this_dir)
 
+
+class QuickRunTests(RunTests):
+
+    quicktest_envs = dict(SKIP_RLIMITS=1)
+
+    def run(self):
+        for env_name, env_value in self.quicktest_envs.items():
+            os.environ[env_name] = str(env_value)
+        self.run_tests()
+
+
 install_requires = []
 
 try:
@@ -102,7 +116,7 @@ setup(
     extra_requires={
         "Tyrant": ["pytyrant"],
     },
-    cmdclass = {"test": RunTests},
+    cmdclass = {"test": RunTests, "quicktest": QuickRunTests},
     classifiers=[
         "Development Status :: 5 - Production/Stable",
         "Framework :: Django",