I have recently been tasked with teaching primary school kids python 3, I am okay at it but am still learning. I thought the easiest thing for me to do would be use repl.it classroom edition to allow for the students to access it at home if they wanted. Included in the repl.it classroom is a auto marking system where you can use unittest
to check if their code is correct. I have worked out how to check that variables are correct but I am having difficulty checking the output. The code they are writing is as followed
a = 5
b = 10
print( a + b )
What I need to do is check that they are printing 15. I have tried the following so far, I have imported sys and the unittest function has already been created by repl.it so it's just this function that I can manipulate.
def test_output(self):
output = sys.stdout
self.assertEqual( output, 25 )
but i know this is not correct. If anyone could help me find how to check the output that would be great.