Treading on Python - II - Book Summary

The following post contains a summary of the book titled Treading on Python II by Matt Harrison Programming Styles Python supports three types of programming paradigms Imperative/Procedural Object Oriented Declarative/Functional Iterator Protocol iter is a global built-in function that calls the object’s dunder method __iter__ Writing a for loop based on iterators 1 2 3 4 5 6 7 8 9 10 11 test = [1, 2, 4] for i in test: print(i) iterator = iter(test) while True: try: x = iterator.

Python Testing 101 and Testing 201 with pytest

What did I learn from going through 2 hours of videos on Pytest ? Python Testing 101 pytest the most popular Python package for testing it is also a basis for rich ecosystem for testing plugins unittesting comes with Python. It is used to test the internals of core python. It is a good solid tool but there are a lot of api calls that one might have to learn The test should be divided in to three stages Arrange : Setting up test, variables, data structure Act : Execute the code on the above setting Assert : Assert the way the code has run the test If you are building a user interface, you build a CLI tool and then keep adding additional tests in pytest scripts Python Testing 202 .