Registry /
testing / robotframework-assertion-engine
Install & Compatibility
Where this runs
tested against v5.0.1 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.702s · 24.1MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 2.0s · import 0.668s · 25MB
23MB installed
● package 23MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
AssertionOperator
✓ from assertionengine import AssertionOperator
✗ from AssertionEngine import AssertionEngine
verify_assertion
✓ from assertionengine import verify_assertion
✗ from AssertionEngine import AssertionEngine
assertion_engine
✓ from assertionengine import assertion_engine
✗ from AssertionEngine import AssertionEngine
This quickstart demonstrates how to integrate `robotframework-assertion-engine` into a custom Python library for Robot Framework. The `MyAssertions` class instantiates `AssertionEngine` and exposes keywords like `My Custom Assert Keyword` and `Verify Length` that utilize the engine's `verify_assertion` method. This allows library developers to easily add a wide range of assertions directly within their Python keywords, which can then be called from Robot Framework test cases.
import os
from AssertionEngine import AssertionEngine
class MyAssertions:
def __init__(self):
self._assertion_engine = AssertionEngine()
def my_custom_assert_keyword(self, actual_value, operator, expected_value, message=""):
"""
Performs an assertion using the AssertionEngine.
Example:
| My Custom Assert Keyword | hello | == | hello |
"""
print(f"Performing assertion: '{actual_value}' {operator} '{expected_value}'")
self._assertion_engine.verify_assertion(
actual_value=actual_value,
assertion_operator=operator,
assertion_expected=expected_value,
message=message
)
def verify_length(self, value, operator, expected_length):
"""
Verifies the length of a string or list.
Example:
| Verify Length | ${MY_LIST} | > | 3 |
"""
actual_length = len(value)
print(f"Verifying length of '{value}' (actual: {actual_length}) {operator} {expected_length}")
self._assertion_engine.verify_assertion(
actual_value=actual_length,
assertion_operator=operator,
assertion_expected=int(expected_length),
message=f"Length of '{value}'"
)
# To run with Robot Framework, save the above as 'MyAssertions.py'
# and create a .robot file like this:
#
# *** Settings ***
# Library MyAssertions.py
#
# *** Variables ***
# ${MY_LIST} ${{ [1, 2, 3, 4, 5] }}
#
# *** Test Cases ***
# Test String Equality
# My Custom Assert Keyword hello == hello
#
# Test String Inequality
# My Custom Assert Keyword world != robot
#
# Test Length Greater Than
# Verify Length ${MY_LIST} > 3
#
# Test Length Equal To
# Verify Length Python == 6
Debug
Known issues
breakingVersion 3.0.0 introduced backwards incompatible changes to how scopes are defined. Scoping is now entirely managed by the library maintainer, and AssertionEngine no longer provides a keyword for scope definition.fixReview your custom library's scope management and adjust it to directly handle scope definitions without relying on AssertionEngine's previous keyword-based mechanism.
affects: >=3.0.0
breakingVersion 2.0.0 changed the logging of string error messages. Instead of plain text, strings are now converted using `repr()` to a printable representation, which includes Unicode values for whitespace characters. This can alter the appearance of error messages in logs.fixAdjust any automated parsing or expectations of error log formats, as string representations will now be more explicit (e.g., `\n` instead of a newline character).
affects: >=2.0.0
gotchaAssertionEngine v3.0.0 caused compatibility issues with `robotframework-browser` v16.0.0 (and Robot Framework 6.1.1) due to changes in the `Formatter()` constructor. This could lead to `TypeError: Formatter() takes no arguments` errors during library initialization.fixEnsure `robotframework-browser` is updated to a compatible version (e.g., v17.0.0 or newer), or pin `robotframework-assertion-engine` to version `2.0.0` if `robotframework-browser` cannot be updated.
affects: 3.0.0 - 3.x.x (when used with older `robotframework-browser` versions)
deprecatedPython 3.7 support was dropped in version 1.1.0. The library currently requires Python 3.10 or newer.fixUpgrade your Python environment to 3.10 or a newer supported version.
affects: >=1.1.0
Upgrade
Version history
5.0.1latest on PyPI · released Jun 4, 2026
Audit
Dependencies
robotframeworkrequiredCore dependency for creating and running Robot Framework tests and libraries.