pytest-excel is a plugin for pytest that enables the generation of detailed Excel reports from test results. Currently at version 1.8.1, the library maintains an active development status with regular updates, including recent support for Python 3.11+.
pip install pytest-excel openpyxlNo compatibility data collected yet for this library.
Install the plugin, then run your pytest tests from the command line, specifying the `--excelreport` option with a desired filename. The plugin automatically integrates with pytest's test discovery and execution. Use `--collect-only` to generate a report with test names and docstrings without actual execution.
Upgrade your Python environment to 3.11+ or pin `pytest-excel` to a version <1.8.0 if you need to support older Python.
Be aware of configuration precedence. If your report name isn't as expected, check if a CLI argument is overriding your `pytest.ini` or `pyproject.toml` setting.
Review your `conftest.py` files and any custom plugins for deprecated `pytest` hook annotations or reliance on older marker parsing. Consult `pytest` and `pytest-excel` documentation for updated patterns.
Ensure your test files and functions follow pytest's naming conventions. For example, `test_my_module.py` containing `def test_feature():`.
Verify that you are passing the `--excelreport=your_report_name.xls` argument when running pytest. Ensure tests are collected and passing, and check file write permissions in the target directory. Use `-v` for verbose output to confirm test collection and execution.
This is often a conflict with custom `pytest` collection or reporting hooks. Review your `conftest.py` for custom `pytest_collect_file` or `pytest_runtest_makereport` implementations that might not be fully compatible with `pytest-excel`'s internal item structure. Simplification of custom hooks or adapting them to `pytest-excel`'s item types might be necessary. (Specific to highly customized setups).