Skip to content

Commit

Permalink
Merge pull request #1 from eventbrite/validated-marker
Browse files Browse the repository at this point in the history
a __validated__ marker to easily verify if function was decorated wit…
  • Loading branch information
andrewgodwin authored Oct 3, 2016
2 parents 499c95d + 6b4f755 commit dc9774c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions conformity/validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,9 @@ def inner(*passed_args, **passed_kwargs):
# Validate return value
validate(returns, return_value, "return value")
return return_value
inner.__wrapped__ = func
# caveat: checking for f.__validated__ will only work if
# @validate_call is the outermost decorator
inner.__validated__ = True
return inner
return decorator

0 comments on commit dc9774c

Please sign in to comment.