Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![Python Version](https://img.shields.io/badge/python-3.13+-blue.svg)](https://www.python.org/downloads/)
[![License](https://img.shields.io/badge/license-GPL--3.0-green.svg)](LICENSE)
![Development Status](https://img.shields.io/badge/status-beta-orange.svg)
![Version](https://img.shields.io/badge/version-3.6.10-blue.svg)
![Version](https://img.shields.io/badge/version-3.6.11-blue.svg)

**Pyrox** is a Python back-end engine and application framework built on **PyQt6**. It provides a rich set of interfaces, models, services, and abstractions for building industrial automation and desktop applications. Pyrox is designed to be used as a foundation — downstream projects like [ControlRox](https://github.com/iroxusux/ControlRox) build their entire application layer on top of it.

Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "hatchling.build"

[project]
name = "pyrox"
version = "3.6.10"
version = "3.6.11"
authors = [{ name = "Brian LaFond", email = "Brian.L.LaFond@gmail.com" }]
description = "Python based irox engine."
readme = "README.md"
Expand Down
2 changes: 1 addition & 1 deletion pyrox/core/validators.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from typing import Any


def unsafe_assert_is_type(value: Any, type_check: type) -> None:
def unsafe_assert_is_type(value: Any, type_check: type | tuple[type, ...]) -> None:
"""Common use type check assertion.
Useful for single line, compact type checking to raise a common message to the user.
Doesn't return anything, as it is unsafe and will stop execution in place.
Expand Down
7 changes: 7 additions & 0 deletions test/core/test_validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,10 @@ def test_incorrect_value_raises_value_error_with_message(self):
with pytest.raises(ValueError) as context:
unsafe_assert_is_type('string', int)
assert context.exconly() == f'ValueError: Expected type {str(int)}, but got {str(str)}!'

def test_pass_when_tuple_is_correct(self):
unsafe_assert_is_type(1, (int, float))

def test_fail_when_tuple_is_not_correct(self):
with pytest.raises(ValueError):
unsafe_assert_is_type('string', (int, float))
Loading