tests.py: Allow skipping generate-fixtures with --skip-generate

(imported from commit ca3de89fc5cd71e3a60b173275edf7cf74d65cdf)
This commit is contained in:
Keegan McAllister 2012-11-14 15:22:08 -05:00
parent a2750943e3
commit 2a619a0054
1 changed files with 10 additions and 2 deletions

View File

@ -12,7 +12,7 @@ from zephyr.lib.initial_password import initial_password, initial_api_key
import simplejson import simplejson
import subprocess import subprocess
subprocess.check_call("zephyr/tests/generate-fixtures"); import optparse
from django.conf import settings from django.conf import settings
import re import re
@ -516,5 +516,13 @@ class GetUpdatesTest(AuthedTestCase):
self.assertRaises(TornadoAsyncException, json_get_updates, request) self.assertRaises(TornadoAsyncException, json_get_updates, request)
class Runner(DjangoTestSuiteRunner): class Runner(DjangoTestSuiteRunner):
def __init__(self, *args, **kwargs): option_list = (
optparse.make_option('--skip-generate',
dest='generate', default=True, action='store_false',
help='Skip generating test fixtures')
,)
def __init__(self, generate, *args, **kwargs):
if generate:
subprocess.check_call("zephyr/tests/generate-fixtures");
DjangoTestSuiteRunner.__init__(self, *args, **kwargs) DjangoTestSuiteRunner.__init__(self, *args, **kwargs)