Open cryptk opened 7 years ago
@mahmoudimus, what you think about this?
@skudriashev @cryptk that's a seriously cool idea!
@cryptk great idea! are you going to implement it or just would like to propose this feature?
@e0ne Currently I am just proposing it as a feature, sadly I don't currently have the time to write it myself.
Adding other proposes for the decorator:
@time_warning(value=15, unit='ms')
@time_error(value=15, unit='ms')
I was thinking a timer warning exempt decorator but this would be even better!
In a given test suite, some tests are expected to pass in different amounts of time. Currently with the --timer-(ok|warning|error) flags, you can only set the threshold for every test all at once. It would be really nice if there was a decorator that you could use to specify the threshold on a per-test basis.
As an example, I am testing an API where some tests are very fast (list all of your assets) and other tests take longer (create a new asset and wait for it to finish). It would be nice to be able to warn or error if the first test took more than a second, but this would be inappropriate for the latter test (which can take up to a minute).
Something like this would be great