{"id":25840191,"url":"https://github.com/ollipa/chainmock","last_synced_at":"2026-03-07T08:02:16.261Z","repository":{"id":62561649,"uuid":"439545384","full_name":"ollipa/chainmock","owner":"ollipa","description":"Mocking library for Python","archived":false,"fork":false,"pushed_at":"2026-01-10T19:57:04.000Z","size":1083,"stargazers_count":11,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-11T05:53:33.644Z","etag":null,"topics":["mock","mocking","pytest","python","testing"],"latest_commit_sha":null,"homepage":"https://chainmock.readthedocs.io/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ollipa.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2021-12-18T06:30:39.000Z","updated_at":"2026-01-10T19:57:08.000Z","dependencies_parsed_at":"2023-12-16T09:42:46.729Z","dependency_job_id":"115501fa-ea54-48b8-bacc-c573f9c86c42","html_url":"https://github.com/ollipa/chainmock","commit_stats":null,"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"purl":"pkg:github/ollipa/chainmock","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ollipa%2Fchainmock","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ollipa%2Fchainmock/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ollipa%2Fchainmock/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ollipa%2Fchainmock/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ollipa","download_url":"https://codeload.github.com/ollipa/chainmock/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ollipa%2Fchainmock/sbom","scorecard":{"id":705558,"data":{"date":"2025-08-11","repo":{"name":"github.com/ollipa/chainmock","commit":"b1b39256505cefa764767a07aca2bc3852f8d7ac"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.1,"checks":[{"name":"Maintained","score":3,"reason":"4 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 3","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/27 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":"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":"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/ci.yml:78: update your workflow using https://app.stepsecurity.io/secureworkflow/ollipa/chainmock/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:84: update your workflow using https://app.stepsecurity.io/secureworkflow/ollipa/chainmock/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:34: update your workflow using https://app.stepsecurity.io/secureworkflow/ollipa/chainmock/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:37: update your workflow using https://app.stepsecurity.io/secureworkflow/ollipa/chainmock/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:54: update your workflow using https://app.stepsecurity.io/secureworkflow/ollipa/chainmock/ci.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:60: update your workflow using https://app.stepsecurity.io/secureworkflow/ollipa/chainmock/ci.yml/main?enable=pin","Warn: pipCommand not pinned by hash: .github/workflows/ci.yml:44","Info:   0 out of   6 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 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":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/ci.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":"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":"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: MIT License: 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":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"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"}},{"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":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 3 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-22T06:26:56.946Z","repository_id":62561649,"created_at":"2025-08-22T06:26:56.946Z","updated_at":"2025-08-22T06:26:56.946Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30209796,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-07T05:23:27.321Z","status":"ssl_error","status_checked_at":"2026-03-07T05:00:17.256Z","response_time":53,"last_error":"SSL_read: 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":["mock","mocking","pytest","python","testing"],"created_at":"2025-03-01T04:40:53.992Z","updated_at":"2026-03-07T08:02:16.253Z","avatar_url":"https://github.com/ollipa.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003cimg alt=\"chainmock\" src=\"https://github.com/ollipa/chainmock/assets/25169984/ad243761-b2ed-4aff-89e7-699e2b4a7e6d\"\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\u003cstrong\u003eChainmock\u003c/strong\u003e \u003cem\u003e- Mocking library for Python and Pytest.\u003c/em\u003e\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://pypi.org/project/chainmock/\"\u003e\n  \u003cimg src=\"https://img.shields.io/pypi/v/chainmock\" alt=\"pypi\"\u003e\n\u003c/a\u003e\n\u003ca href=\"https://github.com/ollipa/chainmock/actions/workflows/ci.yml\"\u003e\n  \u003cimg src=\"https://github.com/ollipa/chainmock/actions/workflows/ci.yml/badge.svg\" alt=\"ci\"\u003e\n\u003c/a\u003e\n\u003ca href=\"https://chainmock.readthedocs.io/\"\u003e\n  \u003cimg src=\"https://img.shields.io/readthedocs/chainmock\" alt=\"documentation\"\u003e\n\u003c/a\u003e\n\u003ca href=\"./LICENSE\"\u003e\n  \u003cimg src=\"https://img.shields.io/pypi/l/chainmock\" alt=\"license\"\u003e\n\u003c/a\u003e\n\u003c/p\u003e\n\n\u003chr\u003e\n\n\u003cp align=\"center\"\u003e\n\u003ca href=\"https://chainmock.readthedocs.io/\"\u003e\n  \u003cb\u003eDocumentation\u003c/b\u003e\n\u003c/a\u003e\n\u003c/p\u003e\n\n\u003chr\u003e\n\nChainmock is a mocking library for Python and pytest. Under the hood it uses Python standard library mocks providing an alternative syntax to create mocks and assertions. Chainmock also comes with some additional features to make testing faster and more straightforward. The syntax works especially well with pytest fixtures.\n\n## Installation\n\nInstall with pip:\n\n```\npip install chainmock\n```\n\n## Features\n\nChainmock supports all the same features that Python standard library unittest\nmocks support and adds some convenient extra functionality.\n\n- **Mocking**: Create _mocks_ and assert call counts and arguments or replace\n  return values.\n- **Spying**: _Spying_ proxies the calls to the original function or method.\n  With spying you can assert call counts and arguments without mocking.\n- **Stubs**: Easily create _stub_ objects that can be used in tests as fake data\n  or to replace real objects.\n- **Async support**: Chainmock supports mocking and spying _async_ functions and\n  methods. Most of the time it also recognizes automatically when async mocking\n  should be used so it is not any harder than mocking sync code.\n- **Fully type annotated**: The whole codebase is fully type annotated so\n  Chainmock works well with static analysis tools and editor autocomplete.\n- Works with **Python 3.10+ and PyPy3**.\n- Supports `pytest`, `unittest`, and `doctest` test runners.\n\n## Examples\n\nThe entrypoint to Chainmock is the `mocker` function. Import the `mocker`\nfunction as follows:\n\n```python\nfrom chainmock import mocker\n```\n\n### Mocking\n\nTo mock you just give the object that you want to mock to the `mocker` function.\nAfter this you can start mocking individual attributes and methods as follows:\n\n```python\n# Assert that a certain method has been called exactly once\nmocker(Teapot).mock(\"add_tea\").called_once()\n\n# Provide a return value and assert that method has been called twice\nmocker(Teapot).mock(\"brew\").return_value(\"mocked\").called_twice()\n\n# Assert that a method has been called with specific arguments at most twice\nmocker(Teapot).mock(\"add_tea\").all_calls_with(\"green\").call_count_at_most(2)\n```\n\n### Spying\n\nSpying is not any harder than mocking. You just need to call the `spy` method\ninstead of the `mock` method. After spying a callable, it works just like before\nspying and you can start making assertions on it.\n\n```python\n# Assert that a certain method has been called at least once\nmocker(Teapot).spy(\"add_tea\").called()\n\n# Check that a method has been called at most twice and has\n# at least one call with the given argument\nmocker(Teapot).spy(\"add_tea\").any_call_with(\"green\").call_count_at_most(2)\n```\n\n### Stubs\n\nTo create a stub object, just call `mocker` function without any arguments.\n\n```python\n# Create a stub with a method called \"my_method\"\nstub = mocker().mock(\"my_method\").return_value(\"it works!\").self()\nassert stub.my_method() == \"it works!\"\n\n# You can give keyword arguments to the mocker function to quickly set properties\nstub = mocker(my_property=10)\nassert stub.my_property == 10\n```\n\nFor more details and examples, see the [API reference](https://chainmock.readthedocs.io/en/latest/api_reference/).\n\n## Similar projects\n\nIf Chainmock is not what you need, check out also these cool projects:\n\n- [flexmock](https://github.com/flexmock/flexmock): Chainmock's API is heavily\n  inspired by flexmock. Flexmock doesn't use standard library unicttest and it\n  has fully custom mocking implementation. Compared to flexmock, Chainmock has\n  more familiar API if you have been using standard library unittest and\n  Chainmock also supports async mocking and partial argument matching.\n- [pytest-mock](https://github.com/pytest-dev/pytest-mock/): Similar to\n  Chainmock, pytest-mock is a wrapper for standard library unittest. Compared to\n  pytest-mock, Chainmock has a more ergonomic API for mocking and spying.\n\n## Contributing\n\nDo you like this project and want to help? If you need ideas, check out the open issues and feel free to open a new pull request. Bug reports and feature requests are also very welcome.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Follipa%2Fchainmock","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Follipa%2Fchainmock","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Follipa%2Fchainmock/lists"}