Fix a flaky test caused by caching of UserPartition schemes

This commit is contained in:
Calen Pennington
2016-05-19 11:58:52 -04:00
parent 0ade461f2a
commit 76e0482fb8

View File

@@ -131,6 +131,9 @@ class PartitionTestCase(TestCase):
extensions, namespace=USER_PARTITION_SCHEME_NAMESPACE
)
# Be sure to clean up the global scheme_extensions after the test.
self.addCleanup(self.cleanupSchemeExtensions)
# Create a test partition
self.user_partition = UserPartition(
self.TEST_ID,
@@ -145,6 +148,9 @@ class PartitionTestCase(TestCase):
self.user_partition.get_scheme(self.non_random_scheme.name)
self.user_partition.get_scheme(self.random_scheme.name)
def cleanupSchemeExtensions(self):
UserPartition.scheme_extensions = None
class TestUserPartition(PartitionTestCase):
"""Test constructing UserPartitions"""