Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Backports:SLE-15-SP6
python-testfixtures
path-comparsion-312.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File path-comparsion-312.patch of Package python-testfixtures
From 720ff80e9cfff17e4f0af1792d866edf49a8f02b Mon Sep 17 00:00:00 2001 From: Chris Withers <chris@simplistix.co.uk> Date: Mon, 20 Nov 2023 08:20:33 +0000 Subject: [PATCH] Path internals are unequal on Python 3.12 --- testfixtures/comparison.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/testfixtures/comparison.py b/testfixtures/comparison.py index c05ab75..26bddfa 100644 --- a/testfixtures/comparison.py +++ b/testfixtures/comparison.py @@ -4,6 +4,7 @@ from difflib import unified_diff from functools import partial as partial_type, reduce from operator import __or__ +from pathlib import Path from pprint import pformat from typing import ( Dict, Any, Optional, Sequence, Generator, TypeVar, List, Mapping, Pattern, Union, @@ -445,6 +446,10 @@ def compare_partial(x: partial_type, y: partial_type, context: 'CompareContext') 'attributes ', '.%s') +def compare_path(x: Path, y: Path, context: 'CompareContext') -> Optional[str]: + return compare_text(str(x), str(y), context) + + def _short_repr(obj) -> str: repr_ = repr(obj) if len(repr_) > 30: @@ -470,6 +475,7 @@ def _short_repr(obj) -> str: unittest_mock_call.__class__: compare_call, BaseException: compare_exception, partial_type: compare_partial, + Path: compare_path, }
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor