Getting asserting the value None error when unit testing with Pytest Getting asserting the value None error when unit testing with Pytest pandas pandas

Getting asserting the value None error when unit testing with Pytest


I believe that this error occurs because of the function pandas.testing.assert_frame_equal returns None if frames are equal; if they're unequal it raises AssertionError. Therefore you're actually checking assert None.

So I think you should remove assert operator here and just write

testing.assert_frame_equal(expected, result)

Or write

assert testing.assert_frame_equal(expected, result) is None