Commit 76e0482f by Calen Pennington

Fix a flaky test caused by caching of UserPartition schemes

parent 0ade461f
...@@ -131,6 +131,9 @@ class PartitionTestCase(TestCase): ...@@ -131,6 +131,9 @@ class PartitionTestCase(TestCase):
extensions, namespace=USER_PARTITION_SCHEME_NAMESPACE 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 # Create a test partition
self.user_partition = UserPartition( self.user_partition = UserPartition(
self.TEST_ID, self.TEST_ID,
...@@ -145,6 +148,9 @@ class PartitionTestCase(TestCase): ...@@ -145,6 +148,9 @@ class PartitionTestCase(TestCase):
self.user_partition.get_scheme(self.non_random_scheme.name) self.user_partition.get_scheme(self.non_random_scheme.name)
self.user_partition.get_scheme(self.random_scheme.name) self.user_partition.get_scheme(self.random_scheme.name)
def cleanupSchemeExtensions(self):
UserPartition.scheme_extensions = None
class TestUserPartition(PartitionTestCase): class TestUserPartition(PartitionTestCase):
"""Test constructing UserPartitions""" """Test constructing UserPartitions"""
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment