Fix a flaky test caused by caching of UserPartition schemes
This commit is contained in:
@@ -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"""
|
||||
|
||||
Reference in New Issue
Block a user