working with pytest working with pytest testing functions we can test standalone functions as well as classes using pytest for examplegiven the function increment below (which merely adds one to any number passed into it)def increment( )return we can write pytest test for this as followsdef test_increment_integer_ ()assert increment( = the only real difference is that we have not had to make an instance of classorganising tests tests can be grouped together into one or more filespytest will search for all files following the naming convention (file names that either start or end with 'test'in specified locationsif no arguments are specified when pytest is run then the search for suitably named test files starts from the testpaths environment variable (if configuredor the current directory alternativelycommand line arguments can be used in any combination of directories or filenames etc