From 251226904c6dfb139cab7512b6bb0f0e5111e3c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Fri, 23 Oct 2020 10:38:42 +0200 Subject: [PATCH] Python 3.10 workaround In test_context_is_not_optional(), only check the exception type. Resolves https://bugzilla.redhat.com/show_bug.cgi?id=1889730 Reported upstream: https://github.com/gabrielfalcao/sure/issues/169 --- python-sure.spec | 5 +++++ python3.10-workaround.patch | 19 +++++++++++++++++++ 2 files changed, 24 insertions(+) create mode 100644 python3.10-workaround.patch diff --git a/python-sure.spec b/python-sure.spec index 04b5324..60009e4 100644 --- a/python-sure.spec +++ b/python-sure.spec @@ -13,6 +13,11 @@ Source0: %{pypi_source} # https://github.com/gabrielfalcao/sure/commit/9f0e834b2e5eea5dfe21d5be4ea6a3df47baf0b9 Patch1: 9f0e834b2e5eea5dfe21d5be4ea6a3df47baf0b9.patch +# Python 3.10 workaround +# In test_context_is_not_optional(), only check the exception type +# https://github.com/gabrielfalcao/sure/issues/169 +Patch2: python3.10-workaround.patch + BuildArch: noarch BuildRequires: python3-devel diff --git a/python3.10-workaround.patch b/python3.10-workaround.patch new file mode 100644 index 0000000..9191bab --- /dev/null +++ b/python3.10-workaround.patch @@ -0,0 +1,19 @@ +diff --git a/tests/test_old_api.py b/tests/test_old_api.py +index d63d8fe..2f93bc5 100644 +--- a/tests/test_old_api.py ++++ b/tests/test_old_api.py +@@ -57,10 +57,10 @@ def test_context_is_not_optional(): + assert True + + assert that(it_crashes).raises( +- TypeError, ( +- "the function it_crashes defined at test_old_api.py line 56, is being " +- "decorated by either @that_with_context or @scenario, so it should " +- "take at least 1 parameter, which is the test context"), ++ TypeError, ++ # intentionally empty line 1 ++ # intentionally empty line 2 ++ # intentionally empty line 3 + ) + +