Fix test that checks ID rather than equality

CPython does not guarantee that the id() of integers will be the same
and they should therefore be tested with standard equality.