New submission from Ontje Lünsdorf: The attached doctest raises a warning since Python 3.4:
$ python -m doctest doctest.txt Exception ignored in: <generator object foo at 0x7f9ee38aaca8> Traceback (most recent call last): File "<doctest doctest.txt[1]>", line 4, in foo NameError: name 'socket' is not defined My guess is that doctest cleans up globals() of the test snippet (thereby deleting socket). Afterwards python cleans up the generator by sending in a GeneratorExit exception. The except block will now fail because socket is not available anymore. ---------- components: Tests files: doctest.txt messages: 215750 nosy: oluensdorf priority: normal severity: normal status: open title: doctest cause warnings in tests using generators type: behavior versions: Python 3.4 Added file: http://bugs.python.org/file34760/doctest.txt _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue21178> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com