Guest User

Untitled

a guest
Aug 16th, 2018
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. import wrapt
  2.  
  3.  
  4. @wrapt.decorator
  5. def its_fine(wrapped, instance, args, kwargs):
  6. """Decorator for fixing tests
  7.  
  8. Example::
  9.  
  10. from fixer import its_fine
  11.  
  12. @its_fine
  13. def test_something():
  14. assert 1 == 0
  15.  
  16. """
  17. try:
  18. return wrapped(*args, **kwargs)
  19. except AssertionError:
  20. # It's fine.
  21. pass
Add Comment
Please, Sign In to add comment