diff options
author | Matěj Cepl <mcepl@redhat.com> | 2012-02-16 17:51:01 +0100 |
---|---|---|
committer | Matěj Cepl <mcepl@redhat.com> | 2012-02-16 17:51:01 +0100 |
commit | f78eca9d4be9b3b7e1177823a9f520faa5b4055b (patch) | |
tree | 7dd5841d046557aa884483af9573958aa492f0d4 /test/__init__.py | |
parent | 7d08baca38827b59af9592e415bc4778fb8c4958 (diff) | |
download | yamlish-f78eca9d4be9b3b7e1177823a9f520faa5b4055b.tar.gz |
More tests and deleted yamlishwriter-php (there is really nothing there).
Diffstat (limited to 'test/__init__.py')
-rw-r--r-- | test/__init__.py | 20 |
1 files changed, 20 insertions, 0 deletions
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 |