summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCollin Anderson <cmawebsite@gmail.com>2015-01-15 11:04:47 -0500
committerTim Graham <timograham@gmail.com>2015-01-15 19:45:43 -0500
commitfaf0d66a80e09be3656a337c33a8e70c7fbab7e3 (patch)
tree3c548a4d89c077643a981a23b358380fa2c974a2
parent39b58ad95ade8109de0f0ae3930e333b7f689c0f (diff)
Fixed #23850 -- Fixed a migrations test failure on Mac OS X & Python 3
-rw-r--r--tests/migrations/test_commands.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/migrations/test_commands.py b/tests/migrations/test_commands.py
index 91b81d0370..0f86289cff 100644
--- a/tests/migrations/test_commands.py
+++ b/tests/migrations/test_commands.py
@@ -2,6 +2,7 @@
from __future__ import unicode_literals
import codecs
+import importlib
import os
import shutil
@@ -686,6 +687,11 @@ class MakeMigrationsTests(MigrationTestBase):
content = cmd("0001", migration_name_0001)
self.assertIn("dependencies=[\n]", content)
+ # Python 3.3+ importlib caches os.listdir() on some platforms like
+ # Mac OS X (#23850).
+ if hasattr(importlib, 'invalidate_caches'):
+ importlib.invalidate_caches()
+
# generate an empty migration
migration_name_0002 = "my_custom_migration"
content = cmd("0002", migration_name_0002, "--empty")