# Chapter8.py # End to End Overview of syntax -> assertion ''' Debugging 1. syntax errors -> there is no reason to run code if you have syntax errors 2. runtime errors -> errors that occur when you initialize the program 3. exception errors -> errors that occur after runtime (handlers) ------ 4. UI/UX Testing -> tests the user interface and how the user experiences the program 5. Unit Testing -> test the validity of the classes and methods/functions in our program ------ 6. Assertion Testing -> Test expected vs actual results 7 + 3 * 4 = z z -> cc api value<19> (7 + 3) * 4 = z z -> cc api value<40> ''' # Classes and methods -> Effectively test blocks of code # pytest # Basic Structure ## files that start with test_ or end with _test are automatically tested with pytest. Invoice.py -> test_Invoice.py or Invoice_test.py ## test functions/methods they can be automatically discovered with test_objName() addOrder() -> test_addOrder() ## pytest has assert keyword to test expected results # Fixtures -> reuseable blocks of setup code ## the concept of setup code allows us to test and then tear down and reset from the beginning classes and methods ## fixtures can pass parameters (pass data to class) ''' SalesOrder(fname,lname) -> workOrder -> purchaseOrder Test starts Test builds SalesOrder Test test workOrder Test tear down and rebuild SalesOrder Test test purchaseOrder Test end ''' # Markers ## pytest allows you to add markers to skip whole or parts of tests