- Update to 8.2.0:
* The strict option is now correctly respected when comparing nested objects. * When comparing datetime.datetime or datetime.time instances, if the fold is the only thing that's different, it's now shown in the output. * A more detailed exception is now raised when resolving a replacement doesn't give what's expected. * Replacement of methods on instances is now prevented when strict=True. * An exception is now raised when mocking and the original is not in the __dict__ of its containing objects. * Fix bug where replacement of methods on subclasses failed when using Replacer.on_class. * Implement strict comparison as an option for datetime.datetime and datetime.time. * Retire zope.component helpers. * Support bytes in popen.MockPopen commands. * Allow TempDirectory instances to be traversed as pathlib.Path objects. * Use the system default encoding where possible in TempDirectory. * Add TempDirectory option to manage current working directory. * Allow string class attributes to be replaced with Replacer and friends. * Fix nasty bug meaning some Replacer.on_class and Replacer.in_module replacements weren't restored. * Allow an alternative separator to be used for traversal during replacement with Replacer and friends. * Officially support Python 3.12. * Drop support Python 3.6. - Add multibuild to break a cycle. - Drop patch path-comparsion-312.patch, included upstream. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-testfixtures?expand=0&rev=55
This commit is contained in:
3
_multibuild
Normal file
3
_multibuild
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
<multibuild>
|
||||||
|
<package>test</package>
|
||||||
|
</multibuild>
|
@@ -1,40 +0,0 @@
|
|||||||
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,
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
@@ -1,3 +1,35 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Wed May 8 06:08:53 UTC 2024 - Steve Kowalik <steven.kowalik@suse.com>
|
||||||
|
|
||||||
|
- Update to 8.2.0:
|
||||||
|
* The strict option is now correctly respected when comparing nested
|
||||||
|
objects.
|
||||||
|
* When comparing datetime.datetime or datetime.time instances, if the fold
|
||||||
|
is the only thing that's different, it's now shown in the output.
|
||||||
|
* A more detailed exception is now raised when resolving a replacement
|
||||||
|
doesn't give what's expected.
|
||||||
|
* Replacement of methods on instances is now prevented when strict=True.
|
||||||
|
* An exception is now raised when mocking and the original is not in the
|
||||||
|
__dict__ of its containing objects.
|
||||||
|
* Fix bug where replacement of methods on subclasses failed when using
|
||||||
|
Replacer.on_class.
|
||||||
|
* Implement strict comparison as an option for datetime.datetime
|
||||||
|
and datetime.time.
|
||||||
|
* Retire zope.component helpers.
|
||||||
|
* Support bytes in popen.MockPopen commands.
|
||||||
|
* Allow TempDirectory instances to be traversed as pathlib.Path objects.
|
||||||
|
* Use the system default encoding where possible in TempDirectory.
|
||||||
|
* Add TempDirectory option to manage current working directory.
|
||||||
|
* Allow string class attributes to be replaced with Replacer and friends.
|
||||||
|
* Fix nasty bug meaning some Replacer.on_class and Replacer.in_module
|
||||||
|
replacements weren't restored.
|
||||||
|
* Allow an alternative separator to be used for traversal during replacement
|
||||||
|
with Replacer and friends.
|
||||||
|
* Officially support Python 3.12.
|
||||||
|
* Drop support Python 3.6.
|
||||||
|
- Add multibuild to break a cycle.
|
||||||
|
- Drop patch path-comparsion-312.patch, included upstream.
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Mon Dec 11 15:07:33 UTC 2023 - ecsos <ecsos@opensuse.org>
|
Mon Dec 11 15:07:33 UTC 2023 - ecsos <ecsos@opensuse.org>
|
||||||
|
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# spec file for package python-testfixtures
|
# spec file for package python-testfixtures
|
||||||
#
|
#
|
||||||
# Copyright (c) 2023 SUSE LLC
|
# Copyright (c) 2024 SUSE LLC
|
||||||
#
|
#
|
||||||
# All modifications and additions to the file contributed by third parties
|
# All modifications and additions to the file contributed by third parties
|
||||||
# remain the property of their copyright owners, unless otherwise agreed
|
# remain the property of their copyright owners, unless otherwise agreed
|
||||||
@@ -16,31 +16,39 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
|
|
||||||
|
%global flavor @BUILD_FLAVOR@%{nil}
|
||||||
|
%if "%{flavor}" == "test"
|
||||||
|
%define psuffix -test
|
||||||
|
%bcond_without test
|
||||||
|
%else
|
||||||
|
%define psuffix %{nil}
|
||||||
|
%bcond_with test
|
||||||
|
%endif
|
||||||
%{?sle15_python_module_pythons}
|
%{?sle15_python_module_pythons}
|
||||||
Name: python-testfixtures
|
Name: python-testfixtures%{psuffix}
|
||||||
Version: 7.2.2
|
Version: 8.2.0
|
||||||
Release: 0
|
Release: 0
|
||||||
Summary: A collection of helpers and mock objects for unit tests and doc tests
|
Summary: A collection of helpers and mock objects for unit tests and doc tests
|
||||||
License: MIT
|
License: MIT
|
||||||
URL: https://github.com/Simplistix/testfixtures
|
URL: https://github.com/Simplistix/testfixtures
|
||||||
Source: https://files.pythonhosted.org/packages/source/t/testfixtures/testfixtures-%{version}.tar.gz
|
Source: https://files.pythonhosted.org/packages/source/t/testfixtures/testfixtures-%{version}.tar.gz
|
||||||
# PATCH-FIX-UPSTREAM gh#simplistix/testfixtures#720ff80e9cfff17e4f0af1792d866edf49a8f02b
|
BuildRequires: %{python_module base >= 3.7}
|
||||||
Patch0: path-comparsion-312.patch
|
BuildRequires: %{python_module pip}
|
||||||
|
BuildRequires: %{python_module setuptools}
|
||||||
|
BuildRequires: %{python_module wheel}
|
||||||
|
%if %{with test}
|
||||||
BuildRequires: %{python_module Django}
|
BuildRequires: %{python_module Django}
|
||||||
BuildRequires: %{python_module Twisted}
|
BuildRequires: %{python_module Twisted}
|
||||||
BuildRequires: %{python_module pip}
|
|
||||||
BuildRequires: %{python_module pytest >= 3.6}
|
BuildRequires: %{python_module pytest >= 3.6}
|
||||||
BuildRequires: %{python_module pytest-django}
|
BuildRequires: %{python_module pytest-django}
|
||||||
BuildRequires: %{python_module setuptools}
|
BuildRequires: %{python_module sybil >= 6}
|
||||||
BuildRequires: %{python_module sybil >= 3}
|
BuildRequires: %{python_module testfixtures = %{version}}
|
||||||
BuildRequires: %{python_module wheel}
|
%endif
|
||||||
BuildRequires: %{python_module zope.component}
|
|
||||||
BuildRequires: fdupes
|
BuildRequires: fdupes
|
||||||
BuildRequires: python-rpm-macros
|
BuildRequires: python-rpm-macros
|
||||||
Suggests: python-Django
|
Suggests: python-Django
|
||||||
Suggests: python-Twisted
|
Suggests: python-Twisted
|
||||||
Suggests: python-sybil >= 3
|
Suggests: python-sybil >= 6
|
||||||
Suggests: python-zope.component
|
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
%python_subpackages
|
%python_subpackages
|
||||||
|
|
||||||
@@ -63,19 +71,25 @@ chmod a-x docs/*.txt
|
|||||||
%pyproject_wheel
|
%pyproject_wheel
|
||||||
|
|
||||||
%install
|
%install
|
||||||
|
%if %{without test}
|
||||||
%pyproject_install
|
%pyproject_install
|
||||||
%python_expand rm -r %{buildroot}%{$python_sitelib}/testfixtures/tests
|
%python_expand rm -r %{buildroot}%{$python_sitelib}/testfixtures/tests
|
||||||
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
%python_expand %fdupes %{buildroot}%{$python_sitelib}
|
||||||
|
%endif
|
||||||
|
|
||||||
%check
|
%check
|
||||||
|
%if %{with test}
|
||||||
export DJANGO_SETTINGS_MODULE=testfixtures.tests.test_django.settings
|
export DJANGO_SETTINGS_MODULE=testfixtures.tests.test_django.settings
|
||||||
export PYTHONPATH=$(pwd)
|
export PYTHONPATH=$(pwd)
|
||||||
%pytest testfixtures/tests
|
%pytest testfixtures/tests
|
||||||
|
%endif
|
||||||
|
|
||||||
|
%if %{without test}
|
||||||
%files %{python_files}
|
%files %{python_files}
|
||||||
%license LICENSE.txt
|
%license LICENSE.txt
|
||||||
%doc README.rst docs/*.txt
|
%doc README.rst docs/*.txt
|
||||||
%{python_sitelib}/testfixtures
|
%{python_sitelib}/testfixtures
|
||||||
%{python_sitelib}/testfixtures-%{version}.dist-info
|
%{python_sitelib}/testfixtures-%{version}.dist-info
|
||||||
|
%endif
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
@@ -1,3 +0,0 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
|
||||||
oid sha256:80774aecb0249458275ab783f53093fbe75795ff2b3218d22ce3fff0a12c4da6
|
|
||||||
size 133809
|
|
3
testfixtures-8.2.0.tar.gz
Normal file
3
testfixtures-8.2.0.tar.gz
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:ef43b657134c87e8a3044f4b02a32ae2ebddf44b2b97bc7989a20116403988ee
|
||||||
|
size 136662
|
Reference in New Issue
Block a user