[英]Python to write function that check dependencies on other functions
Would like to ask for some advice/ available libraries that can be use to check dependencies between functions.想询问一些可用于检查函数之间依赖关系的建议/可用库。 Function test_isupper() will need to check if test_upper()function is successfully run. Function test_isupper() 需要检查 test_upper() 函数是否成功运行。 Else, not going to run test_isupper()否则,不会运行 test_isupper()
import unittest
class TestStringMethods(unittest.TestCase):
def test_upper(self):
self.assertEqual('foo'.upper(), 'FOO')
def test_isupper(self):
self.assertTrue('FOO'.isupper())
self.assertFalse('Foo'.isupper())
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.