繁体   English   中英

Python 写入 function 检查对其他函数的依赖性

[英]Python to write function that check dependencies on other functions

想询问一些可用于检查函数之间依赖关系的建议/可用库。 Function test_isupper() 需要检查 test_upper() 函数是否成功运行。 否则,不会运行 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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM