vedro-flaky-steps plugin for vedro framework
Project description
Vedro Flaky Steps Plugin
How to install?
To install manually, follow these steps:
- Install the package using pip:
$ pip3 install git+git+https://github.com/miner34006/vedro-flaky-steps@main
How to use?
First you need to deactivate rerunner plugin and activate vedro-flakys-steps plugin (reruns are available with same --reruns
option)
# ./vedro.cfg.py
import vedro
import vedro.plugins.rerunner as rerunner
import vedro_flaky_steps as flaker
class Config(vedro.Config):
class Plugins(vedro.Config.Plugins):
class Rerunner(rerunner.Rerunner):
enabled = False
class FlakySteps(flaker.FlakySteps):
enabled = True
Then you can use @expected_failure
decorator in your Vedro scenarios:
class Scenario(vedro.Scenario):
@expected_failure('.*random.randint.*', continue_on_error=True, comment='your message here')
def your_flaky_step(self):
assert random.randint(0, 1)
Behaviour
expected_failure
has 3 options:
expected_error_regexp
- regular expression to find your expected flaky error.continue_on_error
- flag that tells the plugin whether to perform further steps, when met expected flaky error. If set toTrue
the next step will be executed when flaky step failed with expected error. If set toFalse
scenario will be finished on that step (scenario will have a success status).comment
- any information that will be printed in case expected flaky error was met.
After all scenarios have been finished, summary will be displayed in case at least one flaky error was met:
# 1 expected errors met in 1 scenarios, 1 errors skipped
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
vedro-flaky-steps-1.0.2.tar.gz
(11.5 kB
view hashes)
Built Distribution
Close
Hashes for vedro_flaky_steps-1.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2303ba4703b5ee47089667f3f5b78e0fa6c399f1234d16502cd7ce055c9bbcab |
|
MD5 | 5a38354a31f8987bea1f21bbd8683ef5 |
|
BLAKE2b-256 | 51d7ce2aaa65036d69b61b897245785b88f32e2e77624bc1e3ac365031172d15 |