I am writing a function that checks the output of a notebook file and checks against an assert expression to match the output. But I get a None value when I print the output from the function.
from testbook import testbook
@testbook('ssnn_solved.ipynb', execute=True)
def test_stdout(tb):
score = 0.0
assert tb.cell_output_text(7) == 'Test passed.'
return score+1
assert tb.cell_output_text(13) == 'Test passed.'
return score+1
assert tb.cell_output_text(17) == 'Test passed.'
return score+1
assert tb.cell_output_text(21) == 'Test passed.'
return score+1
res = test_stdout()
print(res)
I want to return the output as 4.0 after running the assert.