1.a “syntaxerror” when an error is reported is a grammatical error
1.common types of anomalies
https://blog.csdn.net/likunkun__/article/details/81916269
2.how to set up a program , let it execute and throw an exception
3. if nothing is added after except ,any exception will be caught, and if it is added,only the exception written will be caught
5.“fininal” executes this program regardless of whether an exception occurs
for example, the following figure prevents program problems from causing files to be opened all the time regardless of whether the program has problems or not add"fininal"
5 add an exception manually by yourself
4.
5.“try” is to execte code that may have an exception, and “expect” is to catch an exception,
5. you can write more than one “except”,and finally write an “expect” to catch all exceptions, and finally if you need to write an last
6. finally is code for releasing resources ,typically database code and file code
7.
8. how to test
9. this is a written program
10. this is a test case
11. write test cases into another file
12. import test module — unittest
13. write our tests into a method, preferably starting with “test”
14. the following code means that the current file is running
15. if the method defined at the begining of “test” is not instantiated in the test, the execution is directly invoked
16.
17. testing a class
18.
19.
20.
21.
22.
23. quantities defined by setup functions in test are default for all other functions
24.
25.basic concepts of unit testing
26.basic organization of unit testing
1.write in notepad and run in cmd
25. what are the commonly used assertion method?
26.
27.
28. how to standardize writing in practical development
29.
30.
31. the “setup” function places some initialization contents, specifically the data needed for the next test
32.
33. using the tearDown function, you can close or delete certain functions and release resources
- summary