{"id":37078441,"url":"https://github.com/qporest/pytest-exception-script","last_synced_at":"2026-01-14T09:10:56.152Z","repository":{"id":62584106,"uuid":"284841200","full_name":"qporest/pytest-exception-script","owner":"qporest","description":"Pytest plugin that takes your application through a script of injected exceptions to determine its resiliency.","archived":false,"fork":false,"pushed_at":"2020-08-04T03:54:18.000Z","size":32,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-22T20:18:17.377Z","etag":null,"topics":["injection","monkey-patching","pytest","pytest-plugin","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/qporest.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}},"created_at":"2020-08-04T00:56:08.000Z","updated_at":"2020-08-04T03:54:20.000Z","dependencies_parsed_at":"2022-11-03T21:48:45.040Z","dependency_job_id":null,"html_url":"https://github.com/qporest/pytest-exception-script","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/qporest/pytest-exception-script","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qporest%2Fpytest-exception-script","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qporest%2Fpytest-exception-script/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qporest%2Fpytest-exception-script/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qporest%2Fpytest-exception-script/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/qporest","download_url":"https://codeload.github.com/qporest/pytest-exception-script/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/qporest%2Fpytest-exception-script/sbom","scorecard":{"id":754453,"data":{"date":"2025-08-11","repo":{"name":"github.com/qporest/pytest-exception-script","commit":"5551cb210a2041473d44ab7f434cdb56e19b96af"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.4,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":0,"reason":"Found 0/9 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/python-publish.yml:1","Warn: no topLevel permission defined: .github/workflows/python-pytest.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/python-publish.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/qporest/pytest-exception-script/python-publish.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/python-publish.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/qporest/pytest-exception-script/python-publish.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/python-pytest.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/qporest/pytest-exception-script/python-pytest.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/python-pytest.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/qporest/pytest-exception-script/python-pytest.yml/master?enable=pin","Warn: pipCommand not pinned by hash: .github/workflows/python-publish.yml:18","Warn: pipCommand not pinned by hash: .github/workflows/python-publish.yml:19","Warn: pipCommand not pinned by hash: .github/workflows/python-pytest.yml:23","Warn: pipCommand not pinned by hash: .github/workflows/python-pytest.yml:24","Info:   0 out of   4 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   4 pipCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: GNU General Public License v3.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-22T21:13:11.414Z","repository_id":62584106,"created_at":"2025-08-22T21:13:11.414Z","updated_at":"2025-08-22T21:13:11.414Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28414840,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T08:38:59.149Z","status":"ssl_error","status_checked_at":"2026-01-14T08:38:43.588Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":["injection","monkey-patching","pytest","pytest-plugin","python"],"created_at":"2026-01-14T09:10:55.556Z","updated_at":"2026-01-14T09:10:56.144Z","avatar_url":"https://github.com/qporest.png","language":"Python","readme":"![Plugin Tests](https://github.com/qporest/pytest-exception-script/workflows/Plugin%20Tests/badge.svg?branch=master)\n# pytest-exception-script\nThe goal of this pytest plugin is to allow quick and easy testing of your application's resiliency. This is accomplished by creating exception scripts / scenarios which allow you to inject exceptions into your code execution without having to repeatedly set-up tests.\n\nThis won't work for applications that have multiple processes, but should work with threads (need to do more testing). Under the hood it's just abusing monkeypatch.\n\n- [Structure](#structure)\n  - [Examples of config files](#examples-of-config-files-)\n  - [What's happening here?](#what-s-happening-here-)\n- [FAQ](#faq)\n\n### Structure\nScripts can be written in YAML or TOML.\nEach script / scenario (these will be used interchangeably below) consists of multiple acts, each of which can have multiple actions. Scenario is successful and complete if every act in it is complete.\n**To have your script detected**: make sure it starts with `chaos_` and is a toml or yaml file. It will get auto-discovered by pytest, or you can call pytest directly against the file.\n\n#### Examples of config files:\nUsing `yaml`\n```\nentry-point: tests.fake_app_success.factory\nnext-point: tests.fake_app_success.process_data\nacts:\n  - tests.fake_app_success.get_data:\n      - exc: KeyError, \"Error in act I\"\n        next-point: \n    tests.fake_app_success.unused_method:\n      - exc: OSError, \"Custom message passed\"\n  - tests.fake_app_success.get_data:\n      - exc: KeyError\n```\nUsing `toml`\n```\nentry-point=\"tests.fake_app_success.factory\"\nnext-point=\"tests.fake_app_success.process_data\"\n[[act]]\n[[act.\"tests.fake_app_success.get_data\"]]\nexc=\"KeyError\"\nnext-point=\"tests.fake_app_success.process_data\"\n[[act]]\n[[act.\"tests.fake_app_success.get_data\"]]\nexc=\"KeyError\"\n[[act]]\n[[act.\"tests.fake_app_success.get_data\"]]\nexc=\"KeyError\"\n```\n#### What's happening here?\n`entry-point` should be a factory for your application that takes no parameters.\n`next-point` - can be specified globally, per act, or both. Once this method gets called script will move on to the next act.\n`acts` - list of acts each of which consists of actors. Each Actor is a method and an exception that it will throw if called during execution.\n`exc` - exception to raise.\n\nSo factory will be loaded and started, upon which first act starts. Every time when `get_data` will get called `KeyError` will be raised. With either a default or a custom message. Once `next-point` gets called next act starts. Once `next-point` of the last act is called the application terminates (hopefully) and all the tests get marked as complete.\n\n## FAQ\n- How do I use this with mocks?\nThe best option for that I think is to create a test factory that mocks everything that needs to be mocked before starting the application.\n- Can't this be done with regular tests?\nYes - absolutely. This in fact still creates tests, but hides some boilerplate. Some additional features might be implemented to make it more convenient and usable.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqporest%2Fpytest-exception-script","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fqporest%2Fpytest-exception-script","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fqporest%2Fpytest-exception-script/lists"}