doctests may provide different output between Python 2.x and 3.x, exactly for cases such as this, but of course other examples would be changed std-lib APIs.
The best bet, as someone has already noted in the comments on your question, is to find ways to produce doctest output that is consistent across 2.x and 3.x.
For your particular example, keep in mind that the definition of a Python long
integer is architecture and interpreter dependent. A nice 128-bit Cray supercomputer would happily consider the result of fib(100)
as a regular integer. So whether you get an L or not on the end of the value is more subtle than just 2.x vs 3.x -- although you are right that in 3.x L is now never displayed.