-
Notifications
You must be signed in to change notification settings - Fork 12
Question about test protocol logging given/when/then #40
Comments
Hi, and thanks for taking an interest in Nimoy! Just to make sure I understand you correctly, you'd expect the output for this test case, on top of the normal output, to be:
and if there were a parameterised Is that the case? If yes, then it's not currently implemented, but definitely something that I can work on. |
Yes that's what I'm looking for with the addition of the keywords:
I only care about parameter values defined in the where block. The idea is that that the exploded where clause plus given/when/then constitute a "test protocol" document while a log showing this plus the results of assert/expect statements constitutes a "test report" document. These documents showing the tests we plan to run plus the results of actually running the tests in human readable form are commonly required by regulators and auditors for software in regulated environments. (E.g. medical, automotive etc. ) We don't want the "protocol" impacted by the execution so we don't need to accommodate changes in code. I'm really excited to find Nimoy as I've used Spock for this in the past and find it much better suited than cucumber etc. which require the feature files to be separate from their implementation. While cucumber might seem to make the protocol easier to report, in my experience separate feature files makes tests less efficient for experienced engineers to develop and can be harder to review, especially over time as multiple teams work on similar tests for different modules. |
I'm happy you like it! I'm the sole maintainer so I'll do my best to get to this. In any case, contributions are always welcome! |
I'm happy to help but would need some pointers on where to start. I can definitely contribute testing help. |
So yeah you can definitely PR a bunch of spec for this. I can then guide you towards the implementation of it as well |
I am not sure if this is possible or not. I don't see an example. I am very experienced with Spock/groovy but not as much with python. For my system we need to capture a test report that logs given/when/then steps as part of test execution.
Would there be a "best" way to do something like the sample below with Nimoy? In Spock we would say given: counter is not set. For tests with where blocks we would want to be able to insert variable values into the log statements.
my_module_spec.py
from nimoy.specification import Specification
The text was updated successfully, but these errors were encountered: