Enhanced PyTest Integration: More Flexible, More Secure, More Powerful
We're excited to announce major improvements to our PyTest integration plugin for Spira. This update brings enhanced security, flexible test mapping options, and significant performance improvements for teams running large test suites.
What's New
Secure Credential Management with Environment Variables
The plugin now supports .env.spira files for credential management, allowing you to keep sensitive authentication details out of version control. Simply create a .env.spira file with your Spira credentials and add it to .gitignore. Your test mappings can remain in the shareable spira.cfg file, giving you the best of both worlds: security and team collaboration.
Five Ways to Map Tests
We've expanded test mapping options to fit your workflow:
- @pytest.mark.spira_id() - Explicit markers for precise control
- Pytest markers - Leverage your existing
@pytest.mark.smokeor@pytest.mark.regressionmarkers - Function-level mapping - Map individual test functions
- Class-level mapping - Map entire test classes with one configuration line
- Default mapping - Automatic fallback for unmapped tests
This flexibility means less configuration overhead and more intuitive test organization.
Batch Mode for Large Test Suites
Running hundreds of tests? Batch mode posts all results in a single API call, delivering 50-70% faster execution for large test suites. Perfect for CI/CD pipelines where every second counts.
Dry Run Mode
Preview what would be posted to Spira without actually posting. Ideal for validating configurations, debugging mappings, or testing new setups safely.
Enhanced Logging and Troubleshooting
Verbose mode now provides detailed insights into test case mappings, API calls, and configuration resolution. Error messages are clearer and more actionable, helping you identify and fix issues quickly.
Command-Line Control
New CLI flags give you runtime control over the integration:
--spira-disabled/--spira-enabled- Toggle integration on/off--spira-batch/--spira-no-batch- Control batch mode--spira-dry-run- Preview without posting
Backward Compatible
Existing configurations continue to work without changes. The old MyClass.myFunction mapping format is fully supported, so you can upgrade immediately and adopt new features at your own pace.
Get Started
Update your plugin with pip install --upgrade pytest-spiratest and explore the new capabilities. Visit our documentation for detailed examples and configuration guides.
These improvements make PyTest integration more powerful and easier to use, whether you're running a handful of tests or managing enterprise-scale test automation.