vedro-flaky-steps


Namevedro-flaky-steps JSON
Version 1.1.1 PyPI version JSON
download
home_pagehttps://github.com/miner34006/vedro-flaky-steps
Summaryvedro-flaky-steps plugin for vedro framework
upload_time2024-01-17 08:12:27
maintainer
docs_urlNone
authorBogdan Polianok
requires_python>=3.7
licenseApache-2.0
keywords
VCS
bugtrack_url
requirements vedro
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Vedro Flaky Steps Plugin

## How to install?

To install plugin, follow these steps:

Using pip:

```shell
$ pip install git+https://github.com/miner34006/vedro-flaky-steps@main

OR

$ pip install vedro-flaky-steps
```

Using Vedro plugin manager:

```shell
$ vedro plugin install vedro-allure-reporter
```

## How to use?

First you need to deactivate rerunner plugin and activate vedro-flakys-steps plugin (reruns are available with same `--reruns` option)

```python
# ./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:
```python
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 to `True` the next step will be executed when flaky step failed with expected error. If set to `False` 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
```

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/miner34006/vedro-flaky-steps",
    "name": "vedro-flaky-steps",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "",
    "author": "Bogdan Polianok",
    "author_email": "miner34006@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/cc/a5/0b3e274219b4f909056cadbd052ecce56eb4ba43f4220cf8bd01f0e2ba24/vedro-flaky-steps-1.1.1.tar.gz",
    "platform": null,
    "description": "# Vedro Flaky Steps Plugin\n\n## How to install?\n\nTo install plugin, follow these steps:\n\nUsing pip:\n\n```shell\n$ pip install git+https://github.com/miner34006/vedro-flaky-steps@main\n\nOR\n\n$ pip install vedro-flaky-steps\n```\n\nUsing Vedro plugin manager:\n\n```shell\n$ vedro plugin install vedro-allure-reporter\n```\n\n## How to use?\n\nFirst you need to deactivate rerunner plugin and activate vedro-flakys-steps plugin (reruns are available with same `--reruns` option)\n\n```python\n# ./vedro.cfg.py\nimport vedro\nimport vedro.plugins.rerunner as rerunner\nimport vedro_flaky_steps as flaker\n\nclass Config(vedro.Config):\n\n    class Plugins(vedro.Config.Plugins):\n\n        class Rerunner(rerunner.Rerunner):\n            enabled = False\n\n        class FlakySteps(flaker.FlakySteps):\n            enabled = True\n```\n\nThen you can use `@expected_failure` decorator in your Vedro scenarios:\n```python\nclass Scenario(vedro.Scenario):\n    @expected_failure('.*random.randint.*', continue_on_error=True, comment='your message here')\n    def your_flaky_step(self):\n        assert random.randint(0, 1)\n```\n\n\n## Behaviour\n\n`expected_failure` has 3 options:\n\n- `expected_error_regexp` - regular expression to find your expected flaky error.\n- `continue_on_error` - flag that tells the plugin whether to perform further steps, when met expected flaky error. If set to `True` the next step will be executed when flaky step failed with expected error. If set to `False` scenario will be finished on that step (scenario will have a success status).\n- `comment` - any information that will be printed in case expected flaky error was met.\n\nAfter all scenarios have been finished, summary will be displayed in case at least one flaky error was met:\n```\n# 1 expected errors met in 1 scenarios, 1 errors skipped\n```\n",
    "bugtrack_url": null,
    "license": "Apache-2.0",
    "summary": "vedro-flaky-steps plugin for vedro framework",
    "version": "1.1.1",
    "project_urls": {
        "Homepage": "https://github.com/miner34006/vedro-flaky-steps"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9f28b57ff2a039ea5821a9811a57857e1842dad804eaff6e2d9c7ffd6040456d",
                "md5": "d27553ace8d297af784cdc64477f8df2",
                "sha256": "be971e1c2454e564764d51baa37486617c4b883ae8d94cd868c9124ff86e68f7"
            },
            "downloads": -1,
            "filename": "vedro_flaky_steps-1.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "d27553ace8d297af784cdc64477f8df2",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 10120,
            "upload_time": "2024-01-17T08:12:25",
            "upload_time_iso_8601": "2024-01-17T08:12:25.996898Z",
            "url": "https://files.pythonhosted.org/packages/9f/28/b57ff2a039ea5821a9811a57857e1842dad804eaff6e2d9c7ffd6040456d/vedro_flaky_steps-1.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "cca50b3e274219b4f909056cadbd052ecce56eb4ba43f4220cf8bd01f0e2ba24",
                "md5": "9073e900a8eba37f107a120aee8955b8",
                "sha256": "d5e58b0987ab0c16e70e8e82055b39b850c768ad4adea08babc79fad6c05b3b7"
            },
            "downloads": -1,
            "filename": "vedro-flaky-steps-1.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "9073e900a8eba37f107a120aee8955b8",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 12177,
            "upload_time": "2024-01-17T08:12:27",
            "upload_time_iso_8601": "2024-01-17T08:12:27.578101Z",
            "url": "https://files.pythonhosted.org/packages/cc/a5/0b3e274219b4f909056cadbd052ecce56eb4ba43f4220cf8bd01f0e2ba24/vedro-flaky-steps-1.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-17 08:12:27",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "miner34006",
    "github_project": "vedro-flaky-steps",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "requirements": [
        {
            "name": "vedro",
            "specs": [
                [
                    "<",
                    "2.0"
                ],
                [
                    ">=",
                    "1.7"
                ]
            ]
        }
    ],
    "lcname": "vedro-flaky-steps"
}
        
Elapsed time: 0.16673s