上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 19 下一页
摘要: dir 可以获取模块的类,方法,变量等属性!!! class Loader(object): def __init__(self): self.cases = {} def load(self, path): print("path is %s " % path) module = importli 阅读全文
posted @ 2020-08-10 10:24 峡谷恶霸 阅读(205) 评论(0) 推荐(0) 编辑
摘要: Python 字典(Dictionary) update()方法 描述 Python 字典(Dictionary) update() 函数把字典dict2的键/值对更新到dict里。 语法 update()方法语法: dict.update(dict2) 参数 dict2 -- 添加到指定字典dic 阅读全文
posted @ 2020-08-07 11:19 峡谷恶霸 阅读(133) 评论(0) 推荐(0) 编辑
摘要: 判断对象是否是类类型,看是否是type 的类型 >>> class B(object):... pass...>>> isinstance(B,type)True>>> class C:... pass...>>> isinstance(C,type)False>>> >>> isinstance( 阅读全文
posted @ 2020-08-07 10:55 峡谷恶霸 阅读(108) 评论(0) 推荐(0) 编辑
摘要: 如果你想知道一个对象在内存中的位置,你可以调用id(对象)来查看 阅读全文
posted @ 2020-08-07 10:50 峡谷恶霸 阅读(162) 评论(0) 推荐(0) 编辑
摘要: class type(object): type 继承自object 阅读全文
posted @ 2020-08-07 10:26 峡谷恶霸 阅读(123) 评论(0) 推荐(0) 编辑
摘要: 描述 isinstance() 函数来判断一个对象是否是一个已知的类型,类似 type()。 isinstance() 与 type() 区别: type() 不会认为子类是一种父类类型,不考虑继承关系。 isinstance() 会认为子类是一种父类类型,考虑继承关系。 如果要判断两个类型是否相同 阅读全文
posted @ 2020-08-07 10:13 峡谷恶霸 阅读(448) 评论(0) 推荐(0) 编辑
摘要: while : ; do ./fault_ganesha_kill_9 ; done 阅读全文
posted @ 2020-08-06 16:19 峡谷恶霸 阅读(75) 评论(0) 推荐(0) 编辑
摘要: https://blog.csdn.net/nitibu/article/details/48161339 阅读全文
posted @ 2020-08-06 15:54 峡谷恶霸 阅读(114) 评论(0) 推荐(0) 编辑
摘要: 写好TestCase 由TestLoader加载TestCase到TestSuite 然后由TextTestRunner来运行TestSuite,运行的结果保存在TextTestResult中。通过命令行或者unittest.main()执行时,main会调用TextTestRunner中的run( 阅读全文
posted @ 2020-08-06 14:19 峡谷恶霸 阅读(132) 评论(0) 推荐(0) 编辑
摘要: 特别注意,类中的测试用例,每次都会被nose 初始化调用创建一个新的类对象,再去执行测试!!!! 阅读全文
posted @ 2020-08-05 15:26 峡谷恶霸 阅读(85) 评论(0) 推荐(0) 编辑
上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 19 下一页