I want to test whether or not the output of two different compilations of the same .tex file under different circumstances is equal.I first considered compiling to pdf and then comparing the pdf's visually, but decided that I want to compare using more than visual equality.
My second approach was compiling to pdf again and then comparing with the python package filecmp, which compares the two files byte-by-byte. However that gave me the result unequal when I expected them to be equal
I then tried compiling the tex file to dvi. When comparing the two dvi files, it failed initially again, but after adding the \year, \day etc. from this answer, the comparison gave the expected result of equal.
My question is the following: Is byte-wise equality of dvi files a good benchmark for testing whether two compilations were "equal"? And what could be the reason for the comparison of the pdf's failing?