pytest testing framework introduction there are several testing frameworks available for pythonalthough only oneunittest comes as part of the typical python installation typical libraries include unit test(which is available within the python distribution by defaultand pytest in this we will look at pytest and how it can be used to write unit tests in python for both functions and classes what is pytestpytest is testing library for pythonit is currently one of the most popular python testing libraries (others include unittest and doctestpytest can be used for various levels of testingalthough its most common application is as unit testing framework it is also often used as testing framework within tdd based development project in factit is used by mozilla and dropbox as their python testing framework pytest offers large number of features and great flexibility in how tests are written and in how set up behaviour is defined it automatically finds test based on naming conventions and can be easily integrated into range of editors and ides including pycharm (cspringer nature switzerland ag huntadvanced guide to python programmingundergraduate topics in computer science