{"id":21840,"library":"qase-pytest","title":"Qase Pytest Plugin","description":"Qase Pytest Plugin integrates pytest with Qase TestOps and Qase Report, allowing you to publish test results, manage test cases, and track test runs. Version 8.1.0 requires Python >=3.9. The library is actively maintained with regular releases.","status":"active","version":"8.1.0","language":"python","source_language":"en","source_url":"https://github.com/qase-tms/qase-python/tree/main/qase-pytest","tags":["qase","pytest","testops","test-reporting","test-management"],"install":[{"cmd":"pip install qase-pytest","lang":"bash","label":"Install via pip"}],"dependencies":[{"reason":"Core testing framework","package":"pytest","optional":false},{"reason":"Shared Qase client utilities","package":"qase-python-commons","optional":false}],"imports":[{"note":"qase_api is a fixture, not a module.","wrong":"import qase_api","symbol":"qase_api","correct":"from qaseio.pytest import qase_api"},{"note":"QaseConfig is exported from the pytest subpackage.","wrong":"from qaseio import QaseConfig","symbol":"QaseConfig","correct":"from qaseio.pytest import QaseConfig"}],"quickstart":{"code":"# conftest.py\nimport os\nimport pytest\nfrom qaseio.pytest import qase_api\n\n@pytest.fixture\ndef api_token(qase_api):\n    qase_api.config.api_token = os.environ.get('QASE_API_TOKEN', '')\n    qase_api.config.project_code = os.environ.get('QASE_PROJECT_CODE', 'PROJ')\n    return qase_api\n\ndef test_example(api_token):\n    assert 1 == 1","lang":"python","description":"Set up Qase API token and project code via environment variables, then run 'pytest --qase' to publish results."},"warnings":[{"fix":"Replace '@pytest.mark.qase(id)' with '@pytest.mark.qase_id(id)'.","message":"Version 8.0.0 replaced the old 'qase' marker with 'qase_id' marker for attaching test case IDs. Existing tests using '@pytest.mark.qase(1)' will not be recognized.","severity":"breaking","affected_versions":">=8.0.0"},{"fix":"Use 'from qaseio.pytest import qase_api' in your conftest.py.","message":"The 'qase_api' fixture must be imported from qaseio.pytest, not from qaseio. Importing from the wrong module will cause a FixtureLookupError.","severity":"gotcha","affected_versions":">=7.0.0"},{"fix":"Use 'pytest --qase-mode testops' instead of setting QASE_MODE environment variable.","message":"In version 7.x, the 'QASE_MODE' environment variable was used to switch between report and testops modes. In 8.x, use '--qase-mode' CLI argument or 'mode' in config.","severity":"deprecated","affected_versions":">=8.0.0"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Use 'from qaseio.pytest import QaseConfig'.","cause":"Importing QaseConfig from the top-level qaseio package instead of the subpackage.","error":"pluggy._manager.PluginValidationError: Plugin 'qaseio.pytest' could not be loaded: (qaseio.pytest) cannot import name 'QaseConfig' from 'qaseio'"},{"fix":"Ensure any test file using 'qase_api' has it imported from qaseio.pytest in conftest.py.","cause":"The fixture 'qase_api' is not automatically available; it must be declared in conftest.py or a plugin.","error":"pytest.fixture.FixtureLookupError: The requested fixture has no fixture defined: qase_api"},{"fix":"Set QASE_API_TOKEN to a valid Qase API token in your environment or in a .env file.","cause":"The QASE_API_TOKEN environment variable is missing or incorrect.","error":"qaseio.exceptions.QaseApiError: Authentication error: Invalid API token"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}