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",
default=False,
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()
if len(args) == 0:
@ -72,7 +76,8 @@ if __name__ == "__main__":
# files, since part of setup is importing the models for all applications in INSTALLED_APPS.
django.setup()
subprocess.call(os.path.join(TOOLS_DIR, 'setup', 'generate-fixtures'))
if options.generate_fixtures:
subprocess.call(os.path.join(TOOLS_DIR, 'setup', 'generate-fixtures'))
TestRunner = get_runner(settings)
test_runner = TestRunner()