Skip to main content

Typhoon HIL plugin for pytest

Project description

PyPI version Python versions See Build Status on Travis CI

Typhoon HIL plugin for pytest


  • specify test parameters in a python module

  • reference them in pytest.mark.parametrize decorators

  • mark tests as Jira+Xray issues

  • send test reports directly to Xray using Xray’s REST API


  • pytest 5+

  • pytz, tzlocal

  • requests 2.23+


You can install “pytest-tytest” via pip from PyPI:

$ pip install pytest-tytest


Credentials for Jira and Xray

Put credentials needed to access Jira and Xray in environment variables or a file.

  • XRAY_HOST: Xray URL, defaults to

  • XRAY_CLIENT_ID: Client ID of your Xray API key

  • XRAY_CLIENT_SECRET: Client secret of your Xray API key

  • JIRA_HOST: Your Jira host, probably

  • JIRA_USER: Your Jira account username, probably your email address

  • JIRA_PASSWORD: Your Jira API token, not your password

You can define credentials as environment variables:

export XRAY_CLIENT_ID=...

Or you can store credentials in a file, for example, /private/secrets:


Don’t put the variable values in quotes.

If you use a file to store credentials, you should use the secrets command line parameter:

pytest –secrets=/private/secrets

Test parameters defined in Python modules

Create a test parameter definition file as a Python module, such as this:

import numpy as np

v_range = [277.0, 278.0]
f_range = np.arange(58, 63, 0.2)
vdc_range = [820.0]

class StayConnected:
    voltage_dip_perc = [22, 45, 85, 95]
    dip_total_time_pu = 0.95

All module attributes will be available at runtime as tytest.runtime_settings.Config.attr_name, for example:

from tytest.runtime_settings import Config as C

@python.mark.parametrize('v_range', C.v_range)
def test_something(v_range):

Specify which parameter definition file you are using in command line:


Marking tests for Xray reporting

Mark your tests with Jira issue keys, such as this:

def test_something():

Associate your test run with a test plan in Xray using the test plan key:

pytest --xray-plan-key=DEMO-1234

If you want to ignore potential networking errors while submitting test reports to Xray, turn this flag on:

pytest --xray-plan-key=DEMO-1234 --xray-fail-silently=True

Command-line parameter summary

pytest invocation now has some additional command line parameters:

                      Specify test config script
--secrets=SECRETS     Full path to secrets file
                      Key of the Xray issue that represents the test plan that is being run
                      Ignore Xray communication errors
                      URL pointing to the Allure report

An example of invoking pytest:

pytest --secrets=/private/secrets --xray-plan-key=PRJ-321 --xray-fail-silently=True --allure-url=


Contributions are very welcome. Tests can be run with tox, please ensure the coverage at least stays the same before you submit a pull request.


Distributed under the terms of the MIT license, “pytest-tytest” is free and open source software


If you encounter any problems, please file an issue along with a detailed description.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pytest-tytest-0.1.13.tar.gz (7.8 kB view hashes)

Uploaded Source

Built Distribution

pytest_tytest-0.1.13-py3-none-any.whl (10.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page