我想在运行时获取测试名称和测试结果.
我的脚本中有方法setup和tearDown方法.在setup,我需要获取测试名称,并且tearDown我需要获得测试结果并测试执行时间.
有没有办法可以做到这一点?
请告诉我如何按升序/降序对字符串列表进行排序,而不考虑特殊字符和大小写.
例如:
list1=['test1_two','testOne','testTwo','test_one']
Run Code Online (Sandbox Code Playgroud)
应用list.sort/sorted方法会生成排序列表
['test1_two', 'testOne', 'testTwo', 'test_one']
Run Code Online (Sandbox Code Playgroud)
但不考虑特殊字符和案例应该是
['testOne','test_one', 'test1_two','testTwo'] OR
['test_one','testOne','testTwo', 'test1_two' ]
Run Code Online (Sandbox Code Playgroud)
list.sort/sorted方法根据字符的ascii值排序但是请告诉我如何实现我期望的一个