vendredi 7 février 2020

testing function in python that need to get input from user and print the output, using pycharm and pytest

I wrote code in python 3, and want to write tests to my code using the Pytest framework. I have one function (the main function) that gets input from the user(a file name), processes it and prints a result to the screen(the answer can be true or false). How can I write a test function that inputs data by herself(for the main input) and check what printed to the console? (I use Pycharm)

Aucun commentaire:

Enregistrer un commentaire