{"id":13771594,"url":"https://github.com/bdsoha/expycted","last_synced_at":"2026-01-14T08:26:09.943Z","repository":{"id":43682310,"uuid":"462910702","full_name":"bdsoha/expycted","owner":"bdsoha","description":"✅ \"Because tests should be easy to read!\" An expectation pattern implementation for Python. Simple, intuitive, readable, and approachable, with ability to plug in to any testing framework that relies on assertions.","archived":false,"fork":false,"pushed_at":"2023-03-01T13:15:56.000Z","size":725,"stargazers_count":6,"open_issues_count":14,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-25T11:49:36.154Z","etag":null,"topics":["assertion-framework","expect","expectation","testing"],"latest_commit_sha":null,"homepage":"","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/bdsoha.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":".github/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2022-02-23T21:24:36.000Z","updated_at":"2025-08-11T15:04:43.000Z","dependencies_parsed_at":"2024-01-12T23:43:03.210Z","dependency_job_id":"326a85f1-b7dd-4d1c-96c5-eca796d1ce56","html_url":"https://github.com/bdsoha/expycted","commit_stats":{"total_commits":92,"total_committers":3,"mean_commits":"30.666666666666668","dds":0.5217391304347826,"last_synced_commit":"6e9dfeeab36923594c21d84240dcfa37062f6f21"},"previous_names":["petereon/expycted"],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/bdsoha/expycted","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bdsoha%2Fexpycted","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bdsoha%2Fexpycted/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bdsoha%2Fexpycted/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bdsoha%2Fexpycted/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bdsoha","download_url":"https://codeload.github.com/bdsoha/expycted/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bdsoha%2Fexpycted/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28413949,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T08:16:59.381Z","status":"ssl_error","status_checked_at":"2026-01-14T08:13:45.490Z","response_time":107,"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":["assertion-framework","expect","expectation","testing"],"created_at":"2024-08-03T17:00:53.183Z","updated_at":"2026-01-14T08:26:09.918Z","avatar_url":"https://github.com/bdsoha.png","language":"Python","readme":"# Expycted\n\n[![Build and Test Python Package](https://github.com/bdsoha/expycted/actions/workflows/python-package.yml/badge.svg)](https://github.com/petereon/expycted/actions/workflows/python-package.yml)\n\n__Table of Contents__\n\n- [Overview](#overview)\n- [Installation](#installation)\n- [Matchers](#matchers)\n    - [Value Matchers](#value-matchers)\n    - [Function Matchers](#function-matchers)\n    - [Filesystem Matchers](#filesystem-matchers)\n- [Development](#development)\n- [Contributing](#contributing)\n\n## Overview\n\n__Expycted__ is yet another `expect` pattern implementation.\n\nIt is not dependent on any testing framework and can plug into any as it is just an abstraction over `assert`.\n\nExamples:\n```python\nfrom expycted import expect\n\nexpect(True).to_not.be_false()                                  # This will succeed\n\nexpect([]).to.be_empty()                                        # This will succeed\n\nexpect([1,2,3]).to.contain(3)                                   # This will succeed\n\nexpect(10).to.equal(\"10\")                                       # This will raise AssertionError\n\nexpect(10).to.be(\"10\")                                          # This will succeed\n\nexpect.function(int).to_raise(ValueError).when_called_with('a') # This will also succeed\n```\n\n**This package was originally written by @petereon, many thanks!**\n\n## Installation\n\n__Expycted__ can be installed from [PyPi](https://pypi.org/project/expycted/) by running:\n```sh\npip install expycted\n```\n\nAlternatively, you can clone the repository and build your own distribution using poetry:\n```sh\ngit clone https://github.com/bdsoha/expycted.git\npoetry build\n```\nThen you can install it using:\n```sh\npip install ./dist/expycted-\u003cversion\u003e-py3-none-any.whl\n```\n\n## Matchers\n\nMatchers are used to ensure some conditions are met on an *expected* value.\n\n## Value Matchers\n\nValue matchers can be used in two equivalent ways demonstrated below:\n\n```python\nexpect.value(10).to.be_greater_than(1)\nexpect(10).to.be_greater_than(1)\n```\n\nCurrently available matchers are: \n\n### Equality and Similarity\n\n#### equal()\nAssert that the *expected* value is equivalent to the *actual* value using the `==` operator.\n- __Definition:__ `equal(self, value)`\n- __Alias:__ `be_equal_to(self, value)` \n\n#### be()\nAssert that the *expected* value is the same as the *actual* value.\n- __Definition:__ `be(self, value)`\n- __Details:__ Assert any of the following conditions:\n    - Assert the *expected* value's string representation is the same as the *actual* value's string representation.\n    - When provided two objects, assert that have the same attributes.\n    - Assert the *expected* value equals the *actual* value.\n    \n### Numeric\n\n#### be_greater_than()\nAssert that the *expected* value is greater than the *actual* value using the `\u003e` operator.\n- __Definition:__ `be_greater_than(self, value)`\n- __Alias:__ `be_greater(self, value)`\n\n#### be_lesser_than()\nAssert that the *expected* value is less than the *actual* value using the `\u003c` operator.\n- __Definition:__ `be_lesser_than(self, value)`\n- __Alias:__ \n    - `be_lesser(self, value)`\n    - `be_less(self, value)`\n    - `be_less_than(self, value)`\n\n#### be_greater_or_equal_to()\nAssert that the *expected* value is greater than the *actual* value using the `\u003e=` operator.\n- __Definition:__ `be_greater_or_equal_to(self, value)`\n- __Alias:__ \n    - `be_greater_or_equal(self, value)`\n    - `be_greater_than_or_equal_to(self, value)`\n\n#### be_lesser_or_equal_to()\nAssert that the *expected* value is less than the *actual* value using the `\u003c=` operator.\n- __Definition:__ `be_lesser_or_equal_to(self, value)`\n- __Alias:__ \n    - `be_lesser_or_equal(self, value)`\n    - `be_less_or_equal(self, value)`\n    - `be_less_than_or_equal_to(self, value)`\n    - `be_lesser_than_or_equal_to(self, value)`\n\n#### be_numeric()\nAssert that the *expected* value is a number or can be parsed as a number from a string representation.\n- __Definition:__ `be_numeric(self)`\n- __Alias:__ `be_a_number(self)`\n\n    \n### Containment and Emptiness\n\n#### contain()\nAssert the *expected* value contains a value using the `in` keyword.\n- __Definition:__ `contain(self, value)`\n- __Alias:__ \n    - `have(self, value)`\n    - `include(self, value)`\n\n#### be_contained_in()\nAssert the *expected* value is contained in a value using the `in` keyword.\n- __Definition:__ `be_contained_in(self, value)`\n- __Alias:__ \n    - `be_in(self, value)`\n    - `be_included_in(self, value)`\n\n#### be_empty()\nAssert that the *expected* value is `iterable` and `False`.\n- __Definition:__ `be_empty(self)`\n\n### Truthiness\n\n#### be_true()\nAssert that the *expected* value is strictly `True`.\n- __Definition:__ `be_true(self)`\n\n#### be_false()\nAssert that the *expected* value is strictly `False`.\n- __Definition:__ `be_false(self)`\n\n#### be_truthy()\nAssert that the *expected* value is equivalent to `True`.\n- __Definition:__ `be_truthy(self)`\n- __Alias:__ \n    - `be_truey(self)`\n    - `be_trueish(self)`\n\n#### be_falsey()\nAssert that the *expected* value is equivalent to `False`.\n- __Definition:__ `be_falsey(self)`\n- __Alias:__ \n    - `be_falsy(self)`\n    - `be_falsish(self)` \n\n### Typing\n\n#### be_of_type()\nAssert that the *expected* value has a given type.\n- __Definition:__ `be_of_type(self, value)`\n- __Alias:__ \n    - `be_type(self, value)`\n    - `have_type(self, value)` \n\n#### inherit()\nAssert that the *expected* value inherits or is a subclass of a given type.\n- __Definition:__ `inherit(self, value)`\n- __Alias:__ \n    - `be_subclass_of(self, value)`\n    - `have_parent(self, value)` \n\n## Function Matchers\n\nFunction matchers can be used as demonstrated below:\n```python\nexpect.function(string.replace).to_return('strength').when_called_with('string', 'ength')\n```\n\nArguments can be passed to the *expected* function using the `.when_called_with` method, *(or its alias methods: `when_called_with_args` and `when_called_with_arguments`)*.\n\n#### to_return()\nAssert that the *expected* function returns the *actual* value, or type, or both.\n- __Definition:__ `to_return(self, value=None, type_of_value=None)`\n\n#### to_raise()\nAssert that the *expected* function raises the *actual* exception of a given type.\n- __Definition:__ `to_raise(self, exception_type)`\n\n\n## Filesystem Matchers\n\nFilesystem matchers can be used as demonstrated below:\n```python\nexpect.folder('/some/folder').to.contain('subfolder')\n```\n\nMatchers can be used with both `expect.folder('/some/folder').to` and `expect.folder('/some/folder').to_not` to check both positive and negative expectations.\n\n#### contain()\nAssert that the *expected* folder contains the *actual* file or folder.\n- __Definition:__ `contain(self, name, type: Union[File, Folder, None, str] = None)`\n- __Details:__ When the `type` argument is specified, it will also assert whether *actual* value is a `File` or `Folder`.\n\n#### contain_file()\nAssert that the *expected* folder contains the *actual* file.\n- __Definition:__ `contain_file(self, name)`\n\n#### contain_folder()\nAssert that the *expected* folder contains the *actual* folder.\n- __Definition:__ `contain_folder(self, name)`\n\n#### exist()\nAssert that the *expected* folder exists.\n- __Definition:__ `exist(self)`\n\n#### be_empty()\nAssert that the *expected* folder is empty.\n- __Definition:__ `be_empty(self)`\n\n\n## Development\n\nFor development a combination of `poetry` and `pipenv` is used. `pipenv` is used to install dependencies and manage virtual environments while `poetry` is used for building and metadata management.\n\nTo begin developing run the following commands in your terminal:\n```sh\n# Clone the repository\ngit clone https://github.com/bdsoha/expycted.git\n\n# Install dependencies\npipenv install\n\n# Run tests\npipenv run test\n\n# Build the package\npipenv run build\n```\n\n## Contributing\n\n__Project is currently in its infancy, contributors, pull requests and issues are welcome__\n","funding_links":[],"categories":["Assertions"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbdsoha%2Fexpycted","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbdsoha%2Fexpycted","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbdsoha%2Fexpycted/lists"}