{"id":28234380,"url":"https://github.com/vedro-universe/vedro-fn","last_synced_at":"2026-02-27T01:32:35.512Z","repository":{"id":273199416,"uuid":"918938239","full_name":"vedro-universe/vedro-fn","owner":"vedro-universe","description":"Enables a functional-style syntax for defining Vedro scenarios","archived":false,"fork":false,"pushed_at":"2025-06-15T18:16:57.000Z","size":45,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-15T07:19:21.478Z","etag":null,"topics":["vedro","vedro-plugin"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vedro-universe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-01-19T09:25:39.000Z","updated_at":"2025-06-15T18:17:01.000Z","dependencies_parsed_at":"2025-06-12T21:45:17.935Z","dependency_job_id":"4f917044-1815-4b19-bb4f-ffd2f72308d5","html_url":"https://github.com/vedro-universe/vedro-fn","commit_stats":null,"previous_names":["vedro-universe/vedro-fn"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/vedro-universe/vedro-fn","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vedro-universe%2Fvedro-fn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vedro-universe%2Fvedro-fn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vedro-universe%2Fvedro-fn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vedro-universe%2Fvedro-fn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vedro-universe","download_url":"https://codeload.github.com/vedro-universe/vedro-fn/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vedro-universe%2Fvedro-fn/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29880761,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-26T23:51:21.483Z","status":"ssl_error","status_checked_at":"2026-02-26T23:50:46.793Z","response_time":89,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["vedro","vedro-plugin"],"created_at":"2025-05-18T22:13:37.846Z","updated_at":"2026-02-27T01:32:35.504Z","avatar_url":"https://github.com/vedro-universe.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# vedro-fn\n\n[![Codecov](https://img.shields.io/codecov/c/github/vedro-universe/vedro-fn/main.svg?style=flat-square)](https://codecov.io/gh/vedro-universe/vedro-fn)\n[![PyPI](https://img.shields.io/pypi/v/vedro-fn.svg?style=flat-square)](https://pypi.python.org/pypi/vedro-fn/)\n[![PyPI - Downloads](https://img.shields.io/pypi/dm/vedro-fn?style=flat-square)](https://pypi.python.org/pypi/vedro-fn/)\n[![Python Version](https://img.shields.io/pypi/pyversions/vedro-fn.svg?style=flat-square)](https://pypi.python.org/pypi/vedro-fn/)\n\nA plugin for the [Vedro](https://vedro.io) framework that enables a functional-style syntax for defining Vedro scenarios.\n\n(!) Starting with [Vedro v1.14](https://vedro.io/blog/whats-new-vedro-v1.14), the functional‑style scenario syntax is available directly in Vedro core. Use vedro-fn only if your project is on Vedro v1.13 or earlier, or if you need backward‑compatibility with older versions.\n\n## Installation\n\n\u003cdetails open\u003e\n\u003csummary\u003eQuick\u003c/summary\u003e\n\u003cp\u003e\n\nFor a quick installation, you can use a plugin manager as follows:\n\n```shell\n$ vedro plugin install vedro-fn\n```\n\n\u003c/p\u003e\n\u003c/details\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003eManual\u003c/summary\u003e\n\u003cp\u003e\n\nTo install manually, follow these steps:\n\n1. Install the package using pip:\n\n```shell\n$ pip3 install vedro-fn\n```\n\n2. Next, activate the plugin in your `vedro.cfg.py` configuration file:\n\n```python\n# ./vedro.cfg.py\nimport vedro\nimport vedro_fn\n\n\nclass Config(vedro.Config):\n    class Plugins(vedro.Config.Plugins):\n        class VedroFn(vedro_fn.VedroFn):\n            enabled = True\n```\n\n\u003c/p\u003e\n\u003c/details\u003e\n\n## Usage\n\n### Basic Example\n\n```python\nimport base64\nfrom vedro_fn import scenario, given, when, then\n\n@scenario()\ndef decode_base64_encoded_str():\n    with given:\n        encoded = \"YmFuYW5h\"\n\n    with when:\n        decoded = base64.b64decode(encoded)\n\n    with then:\n        assert decoded == b\"banana\"\n```\n\nTo run scenarios, use:\n\n```shell\n$ vedro run\n```\n\n### Using Scenario Decorators\n\nScenario decorators (such as `@skip`, `@only`, etc.) can be passed via an extended syntax:\n\n```python\nimport base64\nfrom vedro import skip\nfrom vedro_fn import scenario, given, when, then\n\n@scenario[skip]()\ndef decode_base64_encoded_str():\n    with given:\n        encoded = \"YmFuYW5h\"\n\n    with when:\n        decoded = base64.b64decode(encoded)\n\n    with then:\n        assert decoded == b\"banana\"\n```\n\n### Parametrization\n\nYou can also use Vedro’s built-in `@params` decorator with `@scenario` for parametrized scenarios:\n\n```python\nimport base64\nfrom vedro import params\nfrom vedro_fn import scenario, when, then\n\n@scenario([\n    params(\"YmFuYW5h\", b\"banana\"),\n    params(\"\", b\"\"),\n])\ndef decode_base64_encoded_str(encoded, expected):\n    with when:\n        decoded = base64.b64decode(encoded)\n\n    with then:\n        assert decoded == expected\n```\n\n### Async Example\n\nHere’s an example of an asynchronous scenario:\n\n```python\nfrom vedro_fn import scenario, when, then\nfrom interfaces.api import fetch_users\n\n@scenario()\nasync def fetch_users_from_api():\n    with when:\n        users = await fetch_users()\n\n    with then:\n        assert users == [\n            {\"id\": 1, \"name\": \"Bob\"},\n            {\"id\": 2, \"name\": \"Alice\"},\n        ]\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvedro-universe%2Fvedro-fn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvedro-universe%2Fvedro-fn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvedro-universe%2Fvedro-fn/lists"}