svanoort / pyresttest

Python Rest Testing
Apache License 2.0
1.15k stars 325 forks source link

Getting request times in tests #230

Open wirsingj opened 7 years ago

wirsingj commented 7 years ago

Hey, is there currently a way to get the request response times for each test? The benchmarking feature is powerful, but I'd like to be able to gather this data when running tests.

wirsingj commented 7 years ago

I ended up just adding a 'time' field to the TestResponse class that is populated after the curl call. Its then added to the info level logging output. (Which I instead route to a file)

If this is something people are interested in, I can make a PR.

rolandghub commented 7 years ago

Hi wirsingj, I'm certainly interested in it, could you provide me the sourcecode? As I am quite a beginning python programmer/tester.

wirsingj commented 7 years ago

Couldn't push to this repo- here is the modified file. Do a file diff check on it and the source to see what I modified, and format to your liking :) (pyrestest/pyresttest/resttest.py) resttest.py.zip