diff options
Diffstat (limited to 'meta-python/recipes-devtools/python/python3-click/0001-tests-Fix-test_bytes_args.patch')
| -rw-r--r-- | meta-python/recipes-devtools/python/python3-click/0001-tests-Fix-test_bytes_args.patch | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/meta-python/recipes-devtools/python/python3-click/0001-tests-Fix-test_bytes_args.patch b/meta-python/recipes-devtools/python/python3-click/0001-tests-Fix-test_bytes_args.patch deleted file mode 100644 index e69a37c405..0000000000 --- a/meta-python/recipes-devtools/python/python3-click/0001-tests-Fix-test_bytes_args.patch +++ /dev/null | |||
| @@ -1,41 +0,0 @@ | |||
| 1 | From da83bd7ca0959027086115f23534957b0917aaa5 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Khem Raj <raj.khem@gmail.com> | ||
| 3 | Date: Thu, 27 Apr 2023 22:21:24 -0700 | ||
| 4 | Subject: [PATCH] tests: Fix test_bytes_args | ||
| 5 | |||
| 6 | sys.stdin.encoding is readonly therefore use Mocking to wrap it. | ||
| 7 | Sourced from - Alpine | ||
| 8 | |||
| 9 | Upstream-Status: Pending | ||
| 10 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 11 | --- | ||
| 12 | tests/test_arguments.py | 6 +++++- | ||
| 13 | 1 file changed, 5 insertions(+), 1 deletion(-) | ||
| 14 | |||
| 15 | diff --git a/tests/test_arguments.py b/tests/test_arguments.py | ||
| 16 | index 735df4b..3395c55 100644 | ||
| 17 | --- a/tests/test_arguments.py | ||
| 18 | +++ b/tests/test_arguments.py | ||
| 19 | @@ -1,4 +1,5 @@ | ||
| 20 | import sys | ||
| 21 | +from unittest import mock | ||
| 22 | |||
| 23 | import pytest | ||
| 24 | |||
| 25 | @@ -86,9 +87,12 @@ def test_bytes_args(runner, monkeypatch): | ||
| 26 | ), "UTF-8 encoded argument should be implicitly converted to Unicode" | ||
| 27 | |||
| 28 | # Simulate empty locale environment variables | ||
| 29 | - monkeypatch.setattr(sys.stdin, "encoding", "utf-8") | ||
| 30 | monkeypatch.setattr(sys, "getfilesystemencoding", lambda: "utf-8") | ||
| 31 | monkeypatch.setattr(sys, "getdefaultencoding", lambda: "utf-8") | ||
| 32 | + # sys.stdin.encoding is readonly, needs some extra effort to patch. | ||
| 33 | + stdin = mock.Mock(wraps=sys.stdin) | ||
| 34 | + stdin.encoding = "utf-8" | ||
| 35 | + monkeypatch.setattr(sys, "stdin", stdin) | ||
| 36 | |||
| 37 | runner.invoke( | ||
| 38 | from_bytes, | ||
| 39 | -- | ||
| 40 | 2.40.1 | ||
| 41 | |||
