Replies: 4 comments 4 replies
-
SEE ALSO: As example/solution for this use case NOTES:
HINT: |
Beta Was this translation helpful? Give feedback.
-
@JSorella
SEE ALSO: HINTS:
# -- HINT: Python 2.7 SYNDROME if you use @soft_assertions() decorator
Exception TypeError: 'GeneratorContextManager' object is not callable
Traceback (most recent call last):
...
File "features/steps/number_steps.py", line 26, in <module>
@soft_assertions()
TypeError: 'GeneratorContextManager' object is not callable |
Beta Was this translation helpful? Give feedback.
-
Hi @jenisys, I really appreciate your answers, are really helpful to me.
I have achieved the "continue_after_failed_step" in the following way: I have tried the following in order to achieve a
...of course this didn't work because when I change the Sorry if I'm taking this to a level where the framework isn't supposed to behave, but this is what I really need to achieve (or at least my development team expects me to achieve). PD: |
Beta Was this translation helpful? Give feedback.
-
Hi again @jenisys , I was working with the examples you have updated in the Behave repository to understand more deeply about the Behave behavior and what is capable to do. The main issue with the So, I have concluded that there are two possible ways using Behave:
I am trying to achieve an intermediate option, in which the Hard Asserts should cause the test execution to stop there (and not continue with further steps into the scenario) and the Soft Asserts should allow the test execution to continue with further steps (but marking the step as failed).
... is modified as follows:
.... But I don't know if its possible to add attributes for a certain step inside the step itself. |
Beta Was this translation helpful? Give feedback.
-
Hi,
I want to mark a step as failed but continue with the execution.
For example:
... then consider this step implementation:
As you might be thinking, I added the try / catch block in order to explain you what I need. But, in the
except
block, I want to add an instruction to tell Behave "hey, don't mark this step as passed!! I want to show this step as failed in order to explain this is wrong, but don't stop there, because I need to validate if there is a first result with no content!".Is this possible?
Is there any way to achieve this "cheating" with the framework?
Thanks!!
Beta Was this translation helpful? Give feedback.
All reactions