QA TOUCH + PYTEST

Upload pytest results to your QA Touch test run

Install the pytest-qatouch plugin and mark each test with its QA Touch case number. Your pytest results are then uploaded to the test run you choose.

Setup: pip install, TR markers, five QA Touch settings

pytest runs the tests. QA Touch keeps the record.

Your pytest suite already says what passed and what failed. The QA Touch plugin sends those results to the test run your team reports from, with no copying in between.

  • Problem: Results from a pytest run are copied into QA Touch by hand.

    With the integration: The plugin uploads the results to the test run you specify.

  • Problem: It’s unclear which test belongs to which QA Touch case.

    With the integration: A TR marker with the case number ties each test to its case.

  • Problem: Parameterized tests blur into one result.

    With the integration: pytest.param can mark each parameter set with its own case number.

Illustrative sample data. Test names and case numbers are examples.

What the integration does

Four capabilities from QA Touch’s pytest plugin guide, from install to the uploaded result.

One plugin from PyPI

Install pytest-qatouch with pip. It uploads test results to the test run you specify in your QA Touch portal.

pip

Tests marked with a case number

Decorate a test with @qatouch.TR(number) to link it to its QA Touch test case.

Parameterized tests, one by one

Attach the marker to a parameter set with pytest.param(…, marks=qatouch.TR(number)).

Configured where you prefer

Set five options in pytest.ini or setup.cfg, or pass them as command-line options.

From pip install to results in the test run

Step through the flow. The screens are schematic, drawn from the snippets and labels in the plugin guide.

Your project terminal

Install pytest-qatouch

The plugin comes from PyPI and installs with pip.

Your project test file

Mark each test with its case number

Import qatouch from pytest_qatouch and decorate the test with TR and the QA Touch test case number.

Your project parameterized tests

Mark parameter sets individually

Use pytest.param with a TR mark. A parameter set without a marker isn't mapped to a test case.

Your project pytest.ini or setup.cfg

Set the five QA Touch options

Enable the plugin and give it your subdomain, API token, project key and test run key.

Your project run pytest QA Touch test run

Run pytest, then check the test run

Run your tests as usual. The plugin uploads the results to the test run you specified. Check the test run in QA Touch.

Illustrative sample data. Test names, case numbers and values are examples.

What changes for your QA team

Tests stay in your repository. Outcomes show up in the test run.

No copying results

Results go from pytest to QA Touch through the plugin, so nobody retypes pass and fail.

Case numbers in the code

The marker on each test shows, right where the test is written, which QA Touch case it reports to.

One place to report from

Automated results sit in the same test run as the rest of your testing, ready for the team to review.

Configuration stays with the project

Put the options in pytest.ini or setup.cfg, so everyone who runs the suite uses the same setup.

Who uses it, and for what

Choose a role to see a scenario the integration supports.

A Python suite needs a run to report to

The team tests in pytest and wants its results in QA Touch.

What they do

  1. Set up the QA Touch project, test run and test cases.
  2. Gather the subdomain, API token, project key and test run key.
  3. Hand them to the automation engineer.

Result: the engineer has the five values the plugin needs.

Existing tests need to report

You maintain a pytest suite and want it to feed QA Touch.

What they do

  1. Install pytest-qatouch.
  2. Add the TR marker to each test, and to each parameter set that needs one.
  3. Set the options in pytest.ini or setup.cfg.

Result: each run uploads results to the test run.

Reviewing an automated run

You need to know how many cases passed before sign-off.

What they do

  1. Open the test run in QA Touch after the pytest run.
  2. Check the case results.
  3. Follow up on the failures.

Result: the run shows the latest pytest outcome without manual entry.

You fixed something and want to re-check

You changed code and want to confirm the affected tests pass.

What they do

  1. Re-run the affected pytest tests.
  2. Open the QA Touch test run.
  3. Confirm the case result changed.

Result: the fix is confirmed in the same run the QA team reports from.

Set it up in three parts

These steps follow QA Touch’s pytest plugin guide.

Before you start

  • A Python project that uses pytest, with pip.
  • A QA Touch project with a test run and test cases.
  • Your QA Touch subdomain, API token, project key and test run key.

The guide lists the five settings but doesn’t say where to find the token and keys, which Python or pytest versions it supports, or what happens to tests without a marker. It also doesn’t show a run command, so run pytest as you normally do.

  1. Run pip install pytest-qatouch.
  2. The package comes from PyPI.
  1. Import the marker: from pytest_qatouch import qatouch.
  2. Decorate each test with @qatouch.TR(10), using its QA Touch test case number.
  3. For parameterized tests, use pytest.param(..., marks=qatouch.TR(11)) on each parameter set that needs a case.
  4. Parameter sets without a marker aren't mapped to a test case.
  1. Add a [pytest] section to pytest.ini or setup.cfg, or use command-line options.
  2. Set qatouch to True to enable the plugin.
  3. Set qatouch-subdomain, qatouch-api-token, qatouch-project-key and qatouch-testrun-key.
  4. Run pytest, then check the QA Touch test run.

Tests marked? See how results reach the run.

Questions about the pytest integration

Answers are based on QA Touch’s pytest plugin guide.

What does the QA Touch pytest plugin do?

It uploads pytest test results to the test run you specify in your QA Touch portal. It doesn’t do anything else, according to the guide.

Run pip install pytest-qatouch. The package is available from PyPI.

Import qatouch from pytest_qatouch and decorate the test with @qatouch.TR(number), where number is the QA Touch test case number.

Yes. Attach the marker to a parameter set with pytest.param(…, marks=qatouch.TR(number)). A parameter set without a marker isn’t mapped to a test case.

Five: qatouch (set to True), qatouch-subdomain, qatouch-api-token, qatouch-project-key and qatouch-testrun-key. Set them in a [pytest] section of pytest.ini or setup.cfg, or as command-line options.

The pytest guide doesn’t say. Check QA Touch’s help documentation for the automation configuration and API keys, or ask QA Touch support.

The guide doesn’t list supported Python or pytest versions, and doesn’t describe status mapping. Results go from pytest to QA Touch, and no sync back is described.

Connect pytest to QA Touch

Install the plugin, mark your tests, and let the next pytest run upload to your test run.