{"id":27278929,"url":"https://github.com/victorkuenstler/fluent-assertions","last_synced_at":"2025-04-11T17:20:08.417Z","repository":{"id":257031896,"uuid":"853717637","full_name":"VictorKuenstler/fluent-assertions","owner":"VictorKuenstler","description":"Fluent API for assertions supporting pytest, designed with simplicity and ease of use in mind.","archived":false,"fork":false,"pushed_at":"2024-09-17T18:43:39.000Z","size":12,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-11T17:20:01.331Z","etag":null,"topics":["assertions","pytest","python","testing","typing"],"latest_commit_sha":null,"homepage":"https://victorkuenstler.github.io/fluent-assertions/","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/VictorKuenstler.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":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-09-07T10:38:32.000Z","updated_at":"2024-09-17T19:01:15.000Z","dependencies_parsed_at":"2024-09-14T12:57:19.031Z","dependency_job_id":"494fc659-7f1e-41e3-9153-b4e79e458eaf","html_url":"https://github.com/VictorKuenstler/fluent-assertions","commit_stats":null,"previous_names":["victorkuenstler/fluent-assertions"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VictorKuenstler%2Ffluent-assertions","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VictorKuenstler%2Ffluent-assertions/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VictorKuenstler%2Ffluent-assertions/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/VictorKuenstler%2Ffluent-assertions/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/VictorKuenstler","download_url":"https://codeload.github.com/VictorKuenstler/fluent-assertions/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248447609,"owners_count":21105140,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["assertions","pytest","python","testing","typing"],"created_at":"2025-04-11T17:20:07.882Z","updated_at":"2025-04-11T17:20:08.396Z","avatar_url":"https://github.com/VictorKuenstler.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fluent-assertions for Pytest\n\nThis project aims to provide a **fluent API** for assertions supporting **pytest**, designed with simplicity and ease of use in mind. \n\nThe core idea is to make writing assertions more intuitive, readable, and enjoyable by offering a fluent interface that leverages the power of modern Python **typing**. It aims to be easy to use in any IDE for enhanced developer productivity.\n\n\n*⚠️ Current Status This project is in its early exploratory phase. While the core functionality is present, it is not yet fully mature. Use with caution as the API may evolve rapidly and changes could be breaking.*\n\n\n## 🎯 Features\n\n- Fluent API for pytest assertions.\n- Full typing support for IDE-friendly development.\n- Designed to improve readability and expressiveness of test cases.\n\n## 🛠️ Examples\n\nClasses:\n```python\nfrom fluent_assertions import assert_that\n\ndef test_class(): \n    @dataclasses.dataclass\n    class User:\n        name: str\n        age: int\n    \n    def get_name(self):\n        return self.name\n    \n    list_of_users = [User(name=\"Guenther\", age=51), User(name=\"Jack\", age=12)]\n    (\n        assert_that(list_of_users)\n        .has_size(2)\n        .extracting(User.get_name)\n        .contains_exactly([\"Guenther\", \"Jack\"])\n        .last()\n        .is_equal_to(\"Jack\")\n    )\n\n```\n\nDictionaries:\n```python\ndef test_dict():\n    example_dict = {\n        \"name\": \"Guenther\",\n        \"age\": \"51\",\n    }\n    \n    (\n        assert_that(example_dict)\n        .is_not_empty()\n        .contains_keys([\"name\", \"age\"])\n        .contains_values([\"Guenther\", \"51\"])\n    )\n```\n\nLists:\n```python  \ndef test_list():\n    (\n        assert_that([1, 2, 3])\n        .contains_only(1, 2, 3)\n        .has_size(3)\n        .contains_subsequence([2, 3])\n    )\n\n```\n\n## 📦 Installation\n\nAvailable on PyPi:\n\n```bash\npip install fluent-assertions\n```\n\n## 🤝 Contributing\n\nFeedback and collaboration are highly encouraged! If you encounter bugs, have feature requests, or want to contribute improvements, feel free to open an issue or submit a pull request.\n\n## 🚧 Roadmap\n\n- Add more assertion types and methods.\n- Improve documentation and add examples.\n\n\n## 📜 License\n\nThis project is licensed under the MIT License. See the LICENSE file for more details.\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvictorkuenstler%2Ffluent-assertions","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvictorkuenstler%2Ffluent-assertions","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvictorkuenstler%2Ffluent-assertions/lists"}