Nothing special... I've also environment.py with below after_feature definition:
\ndef after_feature(context, feature):\n f = open(\"mlog.txt\", \"a\")\n f.write(f\"feature status: {feature.status} err msg: {feature.error_message} \")\n for fs in feature.final_status:\n f.write(f\"{fs.name}: {fs.value}\\n\")\n f.close()
Sounds simple... now, when I'm running behave --tags=wip
which should skip the first scenario and execute only the second one (outline) two times, I'm getting summary as expected:
1 feature passed, 0 failed, 0 skipped\n2 scenarios passed, 0 failed, 1 skipped\n6 steps passed, 0 failed, 3 skipped, 0 undefined\nTook 0m0.000s\n
but in the mlog.txt
file I'm getting something surprised me:
after tag: wip\nfeature status: Status.passed err msg: None\npassed: 2\nfailed: 3\nskipped: 1\n
The question is:
\nNot quite:
\nfinal_status
is a constant class-attribute of a Feature base-classfinal_status
is basically a list of Status
enum-values that indicate that the model-element (in this case the Feature
) has reached a final state. Therefore, it is the subset of Status
enum-values that have the final
„property“ (and should not change afterwards in the test run).Feature.final_status
(or better not)
#1198
-
Hi. Feature: showing off behave
Scenario: fun a simple test
Given we have behave installed
When we implement a test
Then behave will test it for us!
@wip
Scenario Outline: Use blender with <thing>
Given I put "<thing>" in a blender,
When I switch the blender on
Then "<kind>" should transform into "<other thing>"
Examples: Amphibians
| thing | other thing | kind |
| Red Tree Frog | mush | animal |
| apples | apple juice | fruit | Nothing special... I've also environment.py with below after_feature definition: def after_feature(context, feature):
f = open("mlog.txt", "a")
f.write(f"feature status: {feature.status} err msg: {feature.error_message} ")
for fs in feature.final_status:
f.write(f"{fs.name}: {fs.value}\n")
f.close() Sounds simple... now, when I'm running
but in the
The question is:
|
Beta Was this translation helpful? Give feedback.
-
Ok... nvm. I found it's my misunderstanding of this field. This is not the counter but enum of possible statuses. I'm right? |
Beta Was this translation helpful? Give feedback.
-
@Marcin-Mach-Samsung SEE ALSO:
|
Beta Was this translation helpful? Give feedback.
-
@Marcin-Mach-Samsung
|
Beta Was this translation helpful? Give feedback.
Not quite:
final_status
is a constant class-attribute of a Feature base-classfinal_status
is basically a list ofStatus
enum-values that indicate that the model-element (in this case theFeature
) has reached a final state. Therefore, it is the subset ofStatus
enum-values that have thefinal
„property“ (and should not change afterwards in the test run).