import os
import sys

os.environ['DJANGO_SETTINGS_MODULE'] = 'tests.settings'

from django.core import management

apps = sys.argv[1:]

if not apps:
    apps = [
        'core',
        'exporting',
        'formatters',
        'lexicon',
        'events',
        'history',
        'models',
        'query',
        'sets',
        'stats',
        'search',
        'subcommands',
        'validation',
    ]

management.call_command('test', *apps)

import os

os.environ['DJANGO_SETTINGS_MODULE'] = 'tests.settings'

from django.core import management

apps = [
    'test',
    'core',
    'exporting',
    'formatters',
    'lexicon',
    'events',
    'history',
    'models',
    'query',
    'sets',
    'stats',
    'search',
    'subcommands',
    'validation',
]

management.call_command(*apps)

--- 
+++ 
@@ -1,24 +1,27 @@
 import os
+import sys
 
 os.environ['DJANGO_SETTINGS_MODULE'] = 'tests.settings'
 
 from django.core import management
 
-apps = [
-    'test',
-    'core',
-    'exporting',
-    'formatters',
-    'lexicon',
-    'events',
-    'history',
-    'models',
-    'query',
-    'sets',
-    'stats',
-    'search',
-    'subcommands',
-    'validation',
-]
+apps = sys.argv[1:]
 
-management.call_command(*apps)
+if not apps:
+    apps = [
+        'core',
+        'exporting',
+        'formatters',
+        'lexicon',
+        'events',
+        'history',
+        'models',
+        'query',
+        'sets',
+        'stats',
+        'search',
+        'subcommands',
+        'validation',
+    ]
+
+management.call_command('test', *apps)
Allow apps to be specified from the command line
