Skip to content

Commit

Permalink
Remove SixDocChecker from test_showevents.
Browse files Browse the repository at this point in the history
  • Loading branch information
junkmd committed Dec 6, 2024
1 parent cb92bec commit 4fb1788
Showing 1 changed file with 3 additions and 16 deletions.
19 changes: 3 additions & 16 deletions comtypes/test/test_showevents.py
Original file line number Diff line number Diff line change
@@ -1,24 +1,11 @@
import doctest
import sys
import re
import unittest


class SixDocChecker(doctest.OutputChecker):
# see https://dirkjan.ochtman.nl/writing/2014/07/06/single-source-python-23-doctests.html
def check_output(self, want, got, optionflags):
if sys.version_info >= (3, 0):
want = re.sub(r"u'(.*?)'", r"'\1'", want)
want = re.sub(r'u"(.*?)"', r'"\1"', want)
return doctest.OutputChecker.check_output(self, want, got, optionflags)


def load_tests(loader, tests, ignore):
import comtypes.test.test_showevents

tests.addTests(
doctest.DocTestSuite(comtypes.test.test_showevents, checker=SixDocChecker())
)
tests.addTests(doctest.DocTestSuite(comtypes.test.test_showevents))
return tests


Expand All @@ -32,9 +19,9 @@ def StdFont_ShowEvents(self):
>>> conn = ShowEvents(font)
# event found: FontEvents_FontChanged
>>> font.Name = 'Arial'
Event FontEvents_FontChanged(None, u'Name')
Event FontEvents_FontChanged(None, 'Name')
>>> font.Italic = True
Event FontEvents_FontChanged(None, u'Italic')
Event FontEvents_FontChanged(None, 'Italic')
>>> PumpEvents(0.01) # just calling. assertion does in `test_pump_events.py`
>>> conn.disconnect()
"""
Expand Down

0 comments on commit 4fb1788

Please sign in to comment.