A count of calls to ut.expect() procedure ? #1349
Replies: 1 comment
-
|
Hello @alan-rosenthal A procedure that is annotated as In order for a test to pass all expectations in that test must pass. The reason why we don't display the number of expectations is because one expectation is often not sufficient to represent a meaningful result and should kot be used as a metric of any kind. What value will you get from having a count of expectations? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Is your feature request related to a problem? Please describe.
Not a problem
Describe the solution you'd like
At the end of a run it shows the number of tests performed, succeeded, and failed. That's fine. But it seems to be counting the number of test procedures that were executed. However, I frequently break the rule of one expectation per procedure. Some of mine have a couple calls to ut.expect() and some work off of lists and have hundreds of calls.
Is it possible to get the number of calls to ut.expect() in the final summary ?
Describe alternatives you've considered
I thought of adding a global counter to the ut.expect() calls like this:
ut.expect(x, 'values do not equal').to_equal(y); expect_count := expect_counter + 1;
and then print out the value of expect_counter .
Additional context
Note
Want to discuss
Beta Was this translation helpful? Give feedback.
All reactions