首先,我对 GAE/Python 很陌生,请多多包涵。这是情况
有一个 test_all.py 来测试我包中的所有测试套件。TestCase 的设置当前看起来像;
import test_settings as policy # has consistency variables <- does not work
...
def setUp(self):
# First, create an instance of the Testbed class.
self.testbed = testbed.Testbed()
# Then activate the testbed, which prepares the service stubs for use.
self.testbed.activate()
# Consistency policy nomal operations
self.policy = None
if policy.policy_flag == 'STRICT':
# Create a consistency policy that will simulate the High Replication consistency model.
self.policy = datastore_stub_util.PseudoRandomHRConsistencyPolicy(probability=0)
# Initialize the datastore stub with this policy.
self.testbed.init_datastore_v3_stub(consistency_policy=self.policy)
这是我用不同的一致性策略设置数据存储以针对它们运行测试的原始尝试。完全失败。
我想要的是从我的根 test_all.py 一次针对不同的数据存储一致性运行我的测试用例使用上述或其他方法,我该怎么做?如何从测试运行器将参数传递给 TestCase?