{"id":13472614,"url":"https://github.com/behave/behave","last_synced_at":"2025-05-13T21:02:55.229Z","repository":{"id":37271569,"uuid":"2642784","full_name":"behave/behave","owner":"behave","description":"BDD, Python style.","archived":false,"fork":false,"pushed_at":"2025-05-06T03:00:00.000Z","size":4544,"stargazers_count":3290,"open_issues_count":99,"forks_count":650,"subscribers_count":121,"default_branch":"main","last_synced_at":"2025-05-06T20:23:12.511Z","etag":null,"topics":["bdd","bdd-framework","behave","behavior-driven-development","cucumber-like","gherkin","python","python3"],"latest_commit_sha":null,"homepage":"https://behave.readthedocs.io/en/latest/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/behave.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGES.rst","contributing":"docs/contributing.rst","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2011-10-25T11:02:35.000Z","updated_at":"2025-05-06T13:02:13.000Z","dependencies_parsed_at":"2024-02-03T17:46:02.119Z","dependency_job_id":"36e20f94-532a-4934-9a48-c1b90400f1f3","html_url":"https://github.com/behave/behave","commit_stats":{"total_commits":1425,"total_committers":89,"mean_commits":16.01123595505618,"dds":0.6028070175438596,"last_synced_commit":"fcfe5af74aa1affb23b34cdeedf6799b56b2a509"},"previous_names":[],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/behave%2Fbehave","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/behave%2Fbehave/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/behave%2Fbehave/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/behave%2Fbehave/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/behave","download_url":"https://codeload.github.com/behave/behave/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254027677,"owners_count":22002091,"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":["bdd","bdd-framework","behave","behavior-driven-development","cucumber-like","gherkin","python","python3"],"created_at":"2024-07-31T16:00:56.268Z","updated_at":"2025-05-13T21:02:55.211Z","avatar_url":"https://github.com/behave.png","language":"Python","readme":"======\nbehave\n======\n\n.. |badge.latest_version| image:: https://img.shields.io/pypi/v/behave.svg\n    :target: https://pypi.python.org/pypi/behave\n    :alt: Latest Version\n\n.. |badge.license| image:: https://img.shields.io/pypi/l/behave.svg\n    :target: https://pypi.python.org/pypi/behave/\n    :alt: License\n\n.. |badge.CI_status| image:: https://github.com/behave/behave/actions/workflows/tests.yml/badge.svg\n    :target: https://github.com/behave/behave/actions/workflows/tests.yml\n    :alt: CI Build Status\n\n.. |badge.docs_status| image:: https://readthedocs.org/projects/behave/badge/?version=latest\n    :target: https://behave.readthedocs.io/en/latest/?badge=latest\n    :alt: Documentation Status\n\n.. |badge.discussions| image:: https://img.shields.io/badge/chat-github_discussions-darkgreen\n   :target: https://github.com/behave/behave/discussions\n   :alt: Discussions at https://github.com/behave/behave/discussions\n\n.. |badge.gitter| image:: https://badges.gitter.im/join_chat.svg\n   :target: https://app.gitter.im/#/room/#behave_behave:gitter.im\n   :alt: Chat at https://gitter.im/behave/behave\n\n.. |badge.gurubase| image:: https://img.shields.io/badge/Gurubase-Ask%20behave%20Guru-006BFF\n   :target: https://gurubase.io/g/behave\n   :alt: Ask behave Guru at https://gurubase.io/g/behave\n\n\n.. |logo| image:: https://raw.github.com/behave/behave/master/docs/_static/behave_logo1.png\n\n|badge.latest_version| |badge.license| |badge.CI_status| |badge.docs_status| |badge.discussions| |badge.gitter| |badge.gurubase|\n\nbehave is behavior-driven development, Python style.\n\n|logo|\n\nBehavior-driven development (or BDD) is an agile software development\ntechnique that encourages collaboration between developers, QA and\nnon-technical or business participants in a software project.\n\n*behave* uses tests written in a natural language style, backed up by Python\ncode.\n\nFirst, `install *behave*.`_\n\n\nNow make a directory called \"features/\".\nIn that directory create a file called \"example.feature\" containing:\n\n.. code-block:: gherkin\n\n    # -- FILE: features/example.feature\n    Feature: Showing off behave\n\n      Scenario: Run a simple test\n        Given we have behave installed\n         When we implement 5 tests\n         Then behave will test them for us!\n\nMake a new directory called \"features/steps/\".\nIn that directory create a file called \"example_steps.py\" containing:\n\n.. code-block:: python\n\n    # -- FILE: features/steps/example_steps.py\n    from behave import given, when, then, step\n\n    @given('we have behave installed')\n    def step_impl(context):\n        pass\n\n    @when('we implement {number:d} tests')\n    def step_impl(context, number):  # -- NOTE: number is converted into integer\n        assert number \u003e 1 or number == 0\n        context.tests_count = number\n\n    @then('behave will test them for us!')\n    def step_impl(context):\n        assert context.failed is False\n        assert context.tests_count \u003e= 0\n\nRun behave:\n\n.. code-block:: console\n\n    $ behave\n    Feature: Showing off behave # features/example.feature:2\n\n      Scenario: Run a simple test          # features/example.feature:4\n        Given we have behave installed     # features/steps/example_steps.py:4\n        When we implement 5 tests          # features/steps/example_steps.py:8\n        Then behave will test them for us! # features/steps/example_steps.py:13\n\n    1 feature passed, 0 failed, 0 skipped\n    1 scenario passed, 0 failed, 0 skipped\n    3 steps passed, 0 failed, 0 skipped, 0 undefined\n\nNow, continue reading to learn how to get the most out of *behave*. To get started,\nwe recommend the `tutorial`_ and then the `feature testing language`_ and\n`api`_ references.\n\n\n.. _`Install *behave*.`: https://behave.readthedocs.io/en/stable/install.html\n.. _`tutorial`: https://behave.readthedocs.io/en/stable/tutorial.html#features\n.. _`feature testing language`: https://behave.readthedocs.io/en/stable/gherkin.html\n.. _`api`: https://behave.readthedocs.io/en/stable/api.html\n\n\nMore Information\n-------------------------------------------------------------------------------\n\n* `behave documentation`_: `latest edition`_, `stable edition`_, `PDF`_\n* `behave.example`_: Behave Examples and Tutorials (docs, executable examples).\n* `changelog`_ (latest changes)\n\n\n.. _behave documentation: https://behave.readthedocs.io/\n.. _changelog:      https://github.com/behave/behave/blob/main/CHANGES.rst\n.. _behave.example: https://github.com/behave/behave.example\n\n.. _`latest edition`: https://behave.readthedocs.io/en/latest/\n.. _`stable edition`: https://behave.readthedocs.io/en/stable/\n.. _PDF:              https://behave.readthedocs.io/_/downloads/en/stable/pdf/\n","funding_links":[],"categories":["Python","Uncategorized","自动化测试","Tools","python3","Behavior-driven Development"],"sub_categories":["Uncategorized","测试框架","Python"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbehave%2Fbehave","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbehave%2Fbehave","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbehave%2Fbehave/lists"}