This is not an answer yet, but it will look ugly in comments. Following works for me, can you check it in your env:
(test)alko@work:~$ cd /tmp
(test)alko@work:/tmp$ cat test.txt
>>> from collections import deque
>>> deque().__init__ # doctest: +ELLIPSIS
<method-wrapper '__init__' of collections.deque object at 0x...>
(test)alko@work:/tmp$ python -m doctest test.txt
(test)alko@work:/tmp$
Update based on comments
As all is ok with this code for you, so your doctest module and ELLIPSIS directive are ok. And as you mentioned that files originate from windows, it is clear, that problem lies in lines endings. Doctest tries to match 0xa37adec>\r\n
with expression 0x...>\n
consumes with ...
variable a37adec
part, just prior to >
sign, and fails on carriage return character.
You might want to run fromdos
utility for all your windows-originated files.
Alternatively you can (and I advise to do so) use git
to manage your development, and it will gladly replace line-endings for you.