tools/test-backend: Add option to skip generate-fixtures.

Not calling generate-fixtures can reduce running time, which is
especially helpful when running a single test.
This commit is contained in:
Eklavya Sharma 2016-07-12 07:29:28 +05:30
parent d7c7279523
commit 0de3b17f19
1 changed files with 6 additions and 1 deletions

View File

@ -52,6 +52,10 @@ if __name__ == "__main__":
action="store_true", action="store_true",
default=False, default=False,
help="Show detailed output") help="Show detailed output")
parser.add_option('--no-generate-fixtures', action="store_false", default=True,
dest="generate_fixtures",
help=("Reduce running time by not calling generate-fixtures. "
"This may cause spurious failures for some tests."))
(options, args) = parser.parse_args() (options, args) = parser.parse_args()
if len(args) == 0: if len(args) == 0:
@ -72,6 +76,7 @@ if __name__ == "__main__":
# files, since part of setup is importing the models for all applications in INSTALLED_APPS. # files, since part of setup is importing the models for all applications in INSTALLED_APPS.
django.setup() django.setup()
if options.generate_fixtures:
subprocess.call(os.path.join(TOOLS_DIR, 'setup', 'generate-fixtures')) subprocess.call(os.path.join(TOOLS_DIR, 'setup', 'generate-fixtures'))
TestRunner = get_runner(settings) TestRunner = get_runner(settings)