Задать вопрос

Тел: +7 965 3737 888

479

Просмотров

0

Ответов

TestCase base class to easily temporarily change module values

<ol><li><p>Base your test case off ModuleTestCase and set a class attribute containing a dictionary of modules which you want to be able to revert the values of.
</p>

 </li>

 <li><p>Use self.modulename.attribute = something in your setUp method or test cases to change the module's attribute values.
</p>

 </li>

 <li><p>The values will be automatically restored when each test case finishes.
</p>

 </li>
</ol><p>For the common case of reverting the settings module, just use the SettingsTestCase as your base class.
</p>

Вопрос полезен? Да0/Нет0
file_3978.py(4.2Кб)
None