
Security News
OWASP 2025 Top 10 Adds Software Supply Chain Failures, Ranked Top Community Concern
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.
pytest-vtestify
Advanced tools
pytest-vtestify is a pytest plugin designed for visual assertion and image comparison, utilizing Structural Similarity Index (SSIM). This package is perfect for validating UI changes or detecting regressions in web and software interfaces.
To install the package, simply run:
pip install pytest-vtestify
You can integrate pytest-vtestify into your test suite by using the visual_assertion fixture. Below is an example of how to compare two images and generate a diff image.
def test_visual_comparison(visual_assertion):
image1 = "path/to/expected_image.png"
image2 = "path/to/actual_image.png"
visual_assertion(image1, image2, threshold=0.95)
pytest-vtestify can also be used to perform visual regression testing in web automation projects, especially when working with dynamic web content. Here's an example using Selenium:
from selenium import webdriver
def test_webpage_visual_comparison(visual_assertion):
driver = webdriver.Chrome()
# Navigate to the webpage and capture a screenshot
driver.get('https://example.com')
driver.save_screenshot('actual_page.png')
# Assume 'expected_page.png' is the expected screenshot
expected_image = 'path/to/expected_page.png'
actual_image = 'actual_page.png'
# Compare screenshots
visual_assertion(expected_image, actual_image, threshold=0.98)
driver.quit()
In this example:
Selenium's webdriver.Chrome() is used to open a web page.
The actual web page screenshot is compared to an expected screenshot using pytest-vtestify.
The threshold value specifies how similar the images should be to pass the test.
When the comparison fails, a diff image will be automatically generated and saved in report/images/diff.png. This diff image contains:
If the report/images folder doesn't exist, the plugin will create it during the test execution and place the diff image inside it.
This project is licensed under the MIT License - see the LICENSE file for details.
In the example provided for web automation testing with Selenium:
visual_assertion fixture from pytest-vtestify.threshold parameter determines how closely the two images should match.This approach is commonly used in visual regression testing for web automation, helping to catch unintended UI changes or regressions.
more question find me on:
FAQs
A pytest plugin for visual assertion using SSIM and image comparison.
We found that pytest-vtestify demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OWASP’s 2025 Top 10 introduces Software Supply Chain Failures as a new category, reflecting rising concern over dependency and build system risks.

Research
/Security News
Socket researchers discovered nine malicious NuGet packages that use time-delayed payloads to crash applications and corrupt industrial control systems.

Security News
Socket CTO Ahmad Nassri discusses why supply chain attacks now target developer machines and what AI means for the future of enterprise security.