Fix test failures with pytest 7.3.0
This commit is contained in:
parent
8ca0bb339c
commit
f540cdafa9
24
pytest-7.3.patch
Normal file
24
pytest-7.3.patch
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
diff --git a/tests/test_arguments.py b/tests/test_arguments.py
|
||||||
|
index 735df4b..3395c55 100644
|
||||||
|
--- a/tests/test_arguments.py
|
||||||
|
+++ b/tests/test_arguments.py
|
||||||
|
@@ -1,4 +1,5 @@
|
||||||
|
import sys
|
||||||
|
+from unittest import mock
|
||||||
|
|
||||||
|
import pytest
|
||||||
|
|
||||||
|
@@ -86,9 +87,12 @@ def test_bytes_args(runner, monkeypatch):
|
||||||
|
), "UTF-8 encoded argument should be implicitly converted to Unicode"
|
||||||
|
|
||||||
|
# Simulate empty locale environment variables
|
||||||
|
- monkeypatch.setattr(sys.stdin, "encoding", "utf-8")
|
||||||
|
monkeypatch.setattr(sys, "getfilesystemencoding", lambda: "utf-8")
|
||||||
|
monkeypatch.setattr(sys, "getdefaultencoding", lambda: "utf-8")
|
||||||
|
+ # sys.stdin.encoding is readonly, needs some extra effort to patch.
|
||||||
|
+ stdin = mock.Mock(wraps=sys.stdin)
|
||||||
|
+ stdin.encoding = "utf-8"
|
||||||
|
+ monkeypatch.setattr(sys, "stdin", stdin)
|
||||||
|
|
||||||
|
runner.invoke(
|
||||||
|
from_bytes,
|
||||||
@ -2,12 +2,17 @@
|
|||||||
|
|
||||||
Name: python-%{pypi_name}
|
Name: python-%{pypi_name}
|
||||||
Version: 8.1.3
|
Version: 8.1.3
|
||||||
Release: 2%{?dist}
|
Release: 3%{?dist}
|
||||||
Summary: Simple wrapper around optparse for powerful command line utilities
|
Summary: Simple wrapper around optparse for powerful command line utilities
|
||||||
|
|
||||||
License: BSD
|
License: BSD
|
||||||
URL: https://github.com/mitsuhiko/click
|
URL: https://github.com/mitsuhiko/click
|
||||||
Source0: %{url}/archive/%{version}/%{pypi_name}-%{version}.tar.gz
|
Source0: %{url}/archive/%{version}/%{pypi_name}-%{version}.tar.gz
|
||||||
|
|
||||||
|
# Fix test failures with pytest 7.3.0
|
||||||
|
# From https://github.com/pallets/click/issues/2489#issuecomment-1504160617 by Ran Benita
|
||||||
|
Patch: pytest-7.3.patch
|
||||||
|
|
||||||
BuildArch: noarch
|
BuildArch: noarch
|
||||||
|
|
||||||
%global _description \
|
%global _description \
|
||||||
@ -49,6 +54,9 @@ sed -i 's|requirements/tests.txt|requirements/tests.in|' tox.ini
|
|||||||
%doc README.rst CHANGES.rst
|
%doc README.rst CHANGES.rst
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Wed Apr 12 2023 Miro Hrončok <mhroncok@redhat.com> - 8.1.3-3
|
||||||
|
- Fix test failures with pytest 7.3.0
|
||||||
|
|
||||||
* Fri Jan 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 8.1.3-2
|
* Fri Jan 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 8.1.3-2
|
||||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user