assamtest

mocha-style tests for python
git clone https://git.ce9e.org/assamtest.git

commit
f824e4e7e8909cf9fde430af933336930b5f2848
parent
116ba89dc51c76830b78f598282a4116bcbc47bf
Author
Tobias Bengfort <tobias.bengfort@posteo.de>
Date
2019-02-09 07:51
use functools.wraps()

Diffstat

M pyt/decorators.py 4 ++++

1 files changed, 4 insertions, 0 deletions


diff --git a/pyt/decorators.py b/pyt/decorators.py

@@ -1,9 +1,11 @@
    1     1 import asyncio
   -1     2 import functools
    2     3 
    3     4 from .expect import expect
    4     5 
    5     6 
    6     7 def fail(fn):
   -1     8 	@functools.wraps(fn)
    7     9 	def wrapper(*args, **kwargs):
    8    10 		with expect.raises(AssertionError):
    9    11 			fn(*args, **kwargs)
@@ -11,12 +13,14 @@ def fail(fn):
   11    13 
   12    14 
   13    15 def skip(fn):
   -1    16 	@functools.wraps(fn)
   14    17 	def wrapper(*args, **kwargs):
   15    18 		pass
   16    19 	return wrapper
   17    20 
   18    21 
   19    22 def async_test(fn):
   -1    23 	@functools.wraps(fn)
   20    24 	def wrapper(*args, **kwargs):
   21    25 		coro = asyncio.coroutine(fn)
   22    26 		future = coro(*args, **kwargs)