Reference address https://blog.csdn.net/YZF_DD/article/details/85118078
Example execution only once during start App, to reduce the time code is run, the package encourages code
@classmethod
setUpClass
tearDownClass
. 1 class TestCase (of unittest.TestCase): 2 @classmethod . 3 DEF setUpClass (Self): . 4 Print ( ' Start Test ' ) . 5 self.driver = . DriverApp () Driver () . 6 . 7 # slide phone screen . 8 DEF test_001 (Self ): 9 for i in the Range (2 ): 10 . GestureMainpulation () swipe_left (self.driver) 11 12 # clicks immediately experience 13 DEF test_002 (Self): 14 AppActions () A (self.driver). 15 16 @classmethod . 17 DEF tearDownClass (Self): 18 is Print ( " End Test " )