Bypassing a decorator for unit testing [duplicate]
问题 This question already has answers here : How to skip or ignore python decorators (3 answers) Closed 4 years ago . I have a decorator @auth which basically checks a database to ensure a user can access a given REST call. I would like to write some unit tests for these calls. My initial idea was to simply monkeypatch the decorator into a pass through that does nothing. (My initial idea failed, so I may just monkeypatch some function inside of @auth so that it always passes, but I'm still