Enhanced PyTest Integration: More Flexible, More Secure, More Powerful

9-Feb-2026 by Simon Bor Product News

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.

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. The latest version is 2.1.0.

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.

Six Ways to Map Tests

We've expanded test mapping options to fit your workflow:

  1. @pytest.mark.spira_id() - Explicit markers for precise control
  2. Pytest markers - Leverage your existing @pytest.mark.smoke or @pytest.mark.regression markers
  3. Function-level mapping - Map individual test functions
  4. Class-level mapping - Map entire test classes with one configuration line
  5. Module-level mapping - Map whole test modules (files) to allow for even more high level reporting
  6. Default mapping - Automatic fallback for unmapped tests (and this is now optional so you can only report exactly the tests you need back to Spira)

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 significantly 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.

Configuration Control

A new [settings] section is available in the spira.cfg file to help set default configurations for enabling the plugin, or always using verbose mode.

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.