From f78eca9d4be9b3b7e1177823a9f520faa5b4055b Mon Sep 17 00:00:00 2001 From: Matěj Cepl Date: Thu, 16 Feb 2012 17:51:01 +0100 Subject: More tests and deleted yamlishwriter-php (there is really nothing there). --- test/__init__.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 test/__init__.py (limited to 'test/__init__.py') diff --git a/test/__init__.py b/test/__init__.py new file mode 100644 index 0000000..9f3cdc6 --- /dev/null +++ b/test/__init__.py @@ -0,0 +1,20 @@ +def TODO(func): + """unittest test method decorator that ignores + exceptions raised by test + + Used to annotate test methods for code that may + not be written yet. Ignores failures in the + annotated test method; fails if the text + unexpectedly succeeds. + """ + def wrapper(*args, **kw): + try: + func(*args, **kw) + succeeded = True + except: + succeeded = False + assert succeeded is False, \ + "%s marked TODO but passed" % func.__name__ + wrapper.__name__ = func.__name__ + wrapper.__doc__ = func.__doc__ + return wrapper -- cgit