Quick wins for a faster PC:
Repair Windows errors before they cause bigger problemsFix Now →Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Generate a JUnit-style XML test report with pytest by adding --junitxml (or --junit-xml) and an output path to your test command:
pytest --junitxml=reports/junit.xml
The report is useful for CI systems and other tools that consume test results. Create the destination directory first if it may not exist, and configure your CI workflow to retain the same file path as an artifact.
Generate the report locally
-
From your project root, make an output directory if needed:
mkdir -p reports -
Run pytest with the report path:
pytest --junitxml=reports/junit.xmlThe equivalent spelling
--junit-xmlis also accepted:Recommended: Update Every Outdated Driver on Your PC in One Scan - Free →Recommended: PC Feels Slow? A Free Scan Shows What's Dragging Windows Down →Recommended: Crashes or Glitches? A Free Driver Scan Usually Finds the Culprit →Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.#1 Best Overall
pytest --junit-xml=reports/junit.xml -
After pytest finishes, check that
reports/junit.xmlexists and point your report viewer or CI upload step at that exact path.
The option writes JUnit-style XML; it does not create a missing parent directory for you. If tests fail, pytest can still write a report containing their results, so CI should preserve the file even when the test step exits unsuccessfully.
Keep the XML report in GitHub Actions
Upload the generated file as an artifact so it remains available after the workflow run. The always() condition makes the upload step eligible to run even when the test step fails.
- name: Run tests
run: pytest tests.py --junitxml=junit/test-results.xml
- name: Upload pytest test results
if: ${{ always() }}
uses: actions/upload-artifact@v4
with:
name: pytest-results
path: junit/test-results.xml
This example assumes the junit/ directory exists before pytest runs. In a matrix workflow, use distinct report paths and artifact names per job—for example, include the Python version—to avoid jobs overwriting or colliding with one another.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Rank #2
Choose report settings deliberately
XML compatibility
Pytest’s junit_family setting accepts legacy, xunit1, and xunit2; xunit2 is the current default. Pytest documentation identifies Jenkins with its JUnit plugin and Azure Pipelines as known xunit2 consumers, but compatibility depends on the actual CI product, plugin, and versions in use. Check the receiving environment before changing the family or relying on a particular parser.
Suite name
junit_suite_name sets the root suite name in the XML. Its documented default is pytest. Set it in pytest configuration if downstream reporting expects a particular suite label.
Reported durations
junit_duration_report defaults to total, which includes setup, test call, and teardown. Set it to call when the report should show only the test function’s call time. These values measure different portions of execution and should not be compared as if they were interchangeable.
Captured output
junit_logging controls whether captured logging, standard output, standard error, or combinations are included; its default is no. The junit_log_passing_tests option controls whether output from passing tests is included when logging is enabled. Including more captured output can make reports larger and noisier, so enable it when that information is useful to the workflow.
Windows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallCrashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minuteCustom XML properties
Pytest warns that record_property and record_xml_attribute can make output fail validation against the latest JUnit XML schema. Check your report consumer’s schema requirements before adding custom properties or attributes. The session-scoped record_testsuite_property fixture is documented as compatible with the latest xunit standard.
Configure settings persistently
Put options that should apply to every run in your pytest configuration file rather than repeating them on the command line. For example, in pytest.ini:
[pytest]
junit_family = xunit2
junit_suite_name = project-tests
junit_duration_report = total
Use only settings your project needs. For instance, retain the default family unless your report consumer requires another format, and choose call instead of total only when excluding setup and teardown time is intentional.
Troubleshoot missing or unusable reports
-
No XML file appears: Confirm the command includes
--junitxml=PATHor--junit-xml=PATH, then verify the path relative to the working directory where pytest ran.Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy. -
Pytest cannot write to the path: Create the parent directory before running the command and ensure the workflow user can write there.
-
The CI artifact is missing: Compare the artifact step’s
pathwith the pytest output path character for character. Ensure the upload step runs after the test step and usesif: ${{ always() }}if it must remain eligible after a test failure. -
Parallel or matrix jobs conflict: Give each job its own XML filename and artifact name, such as a filename that includes the Python version.
-
The consumer rejects the XML: Verify that the consumer accepts the selected
junit_familyand inspect whether custom properties or attributes fromrecord_propertyorrecord_xml_attributeare causing schema validation problems.The Tool Desk
Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy. -
Durations appear unexpectedly high: Check whether the report uses the default
totalduration, which includes setup and teardown, rather thancall. -
The report is too large or noisy: Review
junit_loggingandjunit_log_passing_tests; captured output is optional and defaults to no logging.
Or skip the browser setup
For a separate task—capturing a web page as an image or PDF rather than generating pytest’s test-results XML—ScreenshotNeo offers a single-request screenshot API. This does not replace pytest’s JUnit report option.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
See the ScreenshotNeo API documentation for request options. Before a screenshot, it can accept consent banners and remove known consent platforms, newsletter popups, and chat widgets; those steps can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits are not billed, and response headers report the page verdict and billing status. ScreenshotNeo also has an MCP server for AI agents, with tools for screenshots, page information, and PDF capture. The free plan includes 1,000 screenshots per month with no card; paid plans start at $5 for 3,000. See ScreenshotNeo for product details. Sign up free for 1,000 screenshots a month, with no card required.
Frequently Asked Questions
Can pytest write a JUnit XML report if some tests fail?
Yes. Pytest’s report is intended to contain test results, including failures; the test command can still return a failing exit status.
Does generating a JUnit XML report require an extra pytest plugin?
The built-in pytest command-line option is sufficient; use `–junitxml=PATH` or `–junit-xml=PATH`.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




