pytest-pytestrail is a Pytest plugin designed to facilitate interaction with TestRail, a web-based test case management tool. It allows users to automatically update TestRail test results directly from their Pytest runs. The current version is 0.10.5, and it typically sees minor updates for compatibility and feature enhancements.
pip install pytest-pytestrailNo compatibility data collected yet for this library.
First, create a `pytest.ini` file in your project root to configure TestRail connection details and enable the plugin. Use environment variables for sensitive data like passwords. Then, mark your Pytest tests with `@pytest.mark.testrail()` providing the corresponding TestRail case IDs. Run pytest from the command line.
Ensure `tr-url`, `tr-email`, and `tr-password` (via environment variable or direct value) are correctly set in `pytest.ini` or via command-line flags. Verify network access to the TestRail instance.
Add `addopts = --testrail` under the `[pytest]` section in your `pytest.ini` file, or include `--testrail` when running pytest from the command line.
Double-check the TestRail case IDs in your `@pytest.mark.testrail()` decorators against your TestRail project. Ensure they are enclosed in quotes.
Verify `tr-email` and `tr-password` (or `tr-api-key`) in `pytest.ini` or command-line arguments. Ensure the user has permissions to access the specified TestRail project.
Run `pip install pytest-pytestrail` to ensure the plugin is installed in your active Python environment. If using a virtual environment, ensure it's activated.
Ensure all TestRail case IDs passed to the decorator are strings, e.g., `@pytest.mark.testrail('C1234')` or `@pytest.mark.testrail(['C1234', 'C5678'])`.