Python has a number of different testing libraries available. The default library that comes with Python is unittest. This library is based on JUnit, from Java, and it shows. In this my opinion, the library is not especially user friendly, and there are 12 different tests to choose from, based on the expected outcome of the code. Writing the tests isn't especially intuitive for beginners, partly because of the amount of boilerplate code required just to work with unittest.
While nose2 is available as a third-party testing library, a more popular option is pytest. It requires no boilerplate; most of the time, just having pytest installed on your system is sufficient, though, in some cases, an explicit import of pytest is required. Tests are written as you would write normal Python code; the assert keyword tells the testing framework what the expected outcome...