assert isinstance(int(x), int)Now, to me, this looks pretty similar to
assert Truewhich is a pretty unexciting statement. Of course, I was both amused-and-not-amused when I started getting TypeErrors. Yes, it turns out that int(x) can return a long, which is not an int. Although I doubt that I'd prefer it throwing an exception, there seems to be something strongly disconnected here.
In any case, if you would like to make sure that your functions are being passed integers in the larger sense of the word, the statement you're going for is probably:
assert isinstance(x, (int, long))