{"library":"pytest-spec","title":"pytest-spec: Specification-style Test Output","description":"pytest-spec is a pytest plugin that transforms the standard test execution output into a clear, human-readable specification format, similar to RSpec or Mocha. It uses test names and docstrings to generate descriptive sentences about test behavior. The current version is 6.0.0, and it follows a release cadence tied to pytest and Python major version updates.","language":"python","status":"active","last_verified":"Fri Apr 17","install":{"commands":["pip install pytest-spec"],"cli":null},"imports":[],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"# test_example.py\nimport pytest\n\ndef test_feature_login_successful():\n    \"\"\"When valid credentials are provided, it should allow a user to log in successfully.\"\"\"\n    assert True\n\ndef test_feature_login_failed():\n    \"\"\"When invalid credentials are provided, it should deny access and show an error.\"\"\"\n    assert False\n\n@pytest.mark.parametrize(\"input, expected\", [(\"hello\", \"HELLO\"), (\"world\", \"WORLD\")])\ndef test_string_uppercase_conversion(input, expected):\n    \"\"\"It should correctly convert a given string to uppercase.\"\"\"\n    assert input.upper() == expected\n\n# To run these tests with pytest-spec, simply navigate to the directory\n# containing `test_example.py` in your terminal and run:\n# pytest","lang":"python","description":"Create a test file (e.g., `test_example.py`) and simply run `pytest` from your terminal after installation. pytest-spec automatically modifies the output.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}