parallelize test running

This commit is contained in:
chris meyers
2018-05-12 20:35:01 -04:00
parent 0f98ed5046
commit 97ab6449b9
11 changed files with 51 additions and 14 deletions

View File

@@ -77,7 +77,7 @@ class InstanceManager(models.Manager):
def me(self):
"""Return the currently active instance."""
# If we are running unit tests, return a stub record.
if settings.IS_TESTING(sys.argv):
if settings.IS_TESTING(sys.argv) or hasattr(sys, '_called_from_test'):
return self.model(id=1,
hostname='localhost',
uuid='00000000-0000-0000-0000-000000000000')