From 19ef00370134f1c6dd52ebaab1ff145981610e53 Mon Sep 17 00:00:00 2001 From: furkanonder Date: Fri, 27 Mar 2020 16:22:13 +0300 Subject: [PATCH 01/10] bpo-40086: remove test_etree test case --- Lib/test/test_typing.py | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/Lib/test/test_typing.py b/Lib/test/test_typing.py index 6b0a905048cea3..82aafab9a2ecf0 100644 --- a/Lib/test/test_typing.py +++ b/Lib/test/test_typing.py @@ -358,20 +358,6 @@ def test_union_str_pattern(self): A = Union[str, Pattern] A - def test_etree(self): - # See https://github.com/python/typing/issues/229 - # (Only relevant for Python 2.) - try: - from xml.etree.cElementTree import Element - except ImportError: - raise SkipTest("cElementTree not found") - Union[Element, str] # Shouldn't crash - - def Elem(*args): - return Element(*args) - - Union[Elem, str] # Nor should this - class TupleTests(BaseTestCase): From 55ef2f4a19a5323eb692b35470b3381a071f26f6 Mon Sep 17 00:00:00 2001 From: "blurb-it[bot]" <43283697+blurb-it[bot]@users.noreply.github.com> Date: Fri, 27 Mar 2020 13:29:32 +0000 Subject: [PATCH 02/10] =?UTF-8?q?=F0=9F=93=9C=F0=9F=A4=96=20Added=20by=20b?= =?UTF-8?q?lurb=5Fit.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Misc/NEWS.d/next/Tests/2020-03-27-13-29-31.bpo-40086.YNPe8R.rst | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 Misc/NEWS.d/next/Tests/2020-03-27-13-29-31.bpo-40086.YNPe8R.rst diff --git a/Misc/NEWS.d/next/Tests/2020-03-27-13-29-31.bpo-40086.YNPe8R.rst b/Misc/NEWS.d/next/Tests/2020-03-27-13-29-31.bpo-40086.YNPe8R.rst new file mode 100644 index 00000000000000..d3635d5fcf6460 --- /dev/null +++ b/Misc/NEWS.d/next/Tests/2020-03-27-13-29-31.bpo-40086.YNPe8R.rst @@ -0,0 +1,2 @@ +This test was skipped because cElementTree was deprecated and removed in Python 3 with 36543. So the skipped test was removed. +Patch by Furkan Onder \ No newline at end of file From 8bba36280939054dc3f511b08e26e6faca69a218 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Furkan=20=C3=96nder?= Date: Fri, 27 Mar 2020 22:46:49 +0300 Subject: [PATCH 03/10] update test case --- Lib/test/test_typing.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Lib/test/test_typing.py b/Lib/test/test_typing.py index 82aafab9a2ecf0..4cadee16ceeae9 100644 --- a/Lib/test/test_typing.py +++ b/Lib/test/test_typing.py @@ -358,6 +358,20 @@ def test_union_str_pattern(self): A = Union[str, Pattern] A + def test_etree(self): + # See https://github.com/python/typing/issues/229 + # (Only relevant for Python 2.) + try: + from xml.etree.ElementTree import Element + except ImportError: + raise SkipTest("ElementTree not found") + Union[Element, str] # Shouldn't crash + + def Elem(*args): + return Element(*args) + + Union[Elem, str] # Nor should this + class TupleTests(BaseTestCase): From 65fec26088c99cd0b8ce610e53da3ea7b187d5ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Furkan=20=C3=96nder?= Date: Sat, 28 Mar 2020 00:19:01 +0300 Subject: [PATCH 04/10] update test case --- Lib/test/test_typing.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Lib/test/test_typing.py b/Lib/test/test_typing.py index 4cadee16ceeae9..ad7b5a2a5f01b0 100644 --- a/Lib/test/test_typing.py +++ b/Lib/test/test_typing.py @@ -361,10 +361,8 @@ def test_union_str_pattern(self): def test_etree(self): # See https://github.com/python/typing/issues/229 # (Only relevant for Python 2.) - try: - from xml.etree.ElementTree import Element - except ImportError: - raise SkipTest("ElementTree not found") + from xml.etree.ElementTree import Element + Union[Element, str] # Shouldn't crash def Elem(*args): From 3617ca2daffd7d27955153ab84bca5f2a1bff73f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Furkan=20=C3=96nder?= Date: Sat, 28 Mar 2020 00:25:02 +0300 Subject: [PATCH 05/10] Update test_typing.py --- Lib/test/test_typing.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/Lib/test/test_typing.py b/Lib/test/test_typing.py index ad7b5a2a5f01b0..7387429c9126c2 100644 --- a/Lib/test/test_typing.py +++ b/Lib/test/test_typing.py @@ -359,8 +359,6 @@ def test_union_str_pattern(self): A def test_etree(self): - # See https://github.com/python/typing/issues/229 - # (Only relevant for Python 2.) from xml.etree.ElementTree import Element Union[Element, str] # Shouldn't crash From 5a47e58f94725a8645d15d349069f3861d075ea7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Furkan=20=C3=96nder?= Date: Sat, 28 Mar 2020 00:28:26 +0300 Subject: [PATCH 06/10] add comment --- Lib/test/test_typing.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Lib/test/test_typing.py b/Lib/test/test_typing.py index 7387429c9126c2..ad7b5a2a5f01b0 100644 --- a/Lib/test/test_typing.py +++ b/Lib/test/test_typing.py @@ -359,6 +359,8 @@ def test_union_str_pattern(self): A def test_etree(self): + # See https://github.com/python/typing/issues/229 + # (Only relevant for Python 2.) from xml.etree.ElementTree import Element Union[Element, str] # Shouldn't crash From 2a0c4d3dd16cb2ec2fdf82c2edcc96784368fb1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Furkan=20=C3=96nder?= Date: Sat, 28 Mar 2020 02:05:47 +0300 Subject: [PATCH 07/10] Update 2020-03-27-13-29-31.bpo-40086.YNPe8R.rst --- .../next/Tests/2020-03-27-13-29-31.bpo-40086.YNPe8R.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Misc/NEWS.d/next/Tests/2020-03-27-13-29-31.bpo-40086.YNPe8R.rst b/Misc/NEWS.d/next/Tests/2020-03-27-13-29-31.bpo-40086.YNPe8R.rst index d3635d5fcf6460..398473cf44c7a2 100644 --- a/Misc/NEWS.d/next/Tests/2020-03-27-13-29-31.bpo-40086.YNPe8R.rst +++ b/Misc/NEWS.d/next/Tests/2020-03-27-13-29-31.bpo-40086.YNPe8R.rst @@ -1,2 +1,2 @@ -This test was skipped because cElementTree was deprecated and removed in Python 3 with 36543. So the skipped test was removed. -Patch by Furkan Onder \ No newline at end of file +This test was skipped because cElementTree was deprecated and removed in Python 3 with 36543. So the test case has been updated according to Python 3. +Patch by Furkan Onder From 1c7c22b3382baabee3dada7e1adba362406bfbfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Furkan=20=C3=96nder?= Date: Sat, 28 Mar 2020 02:34:28 +0300 Subject: [PATCH 08/10] delete white space From 0d376756d0cac196aec51dd355d95e36f449a6b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Furkan=20=C3=96nder?= Date: Sat, 28 Mar 2020 14:13:38 +0300 Subject: [PATCH 09/10] delete white space --- Lib/test/test_typing.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/test/test_typing.py b/Lib/test/test_typing.py index ad7b5a2a5f01b0..8d6262b9c1b02b 100644 --- a/Lib/test/test_typing.py +++ b/Lib/test/test_typing.py @@ -362,7 +362,7 @@ def test_etree(self): # See https://github.com/python/typing/issues/229 # (Only relevant for Python 2.) from xml.etree.ElementTree import Element - + Union[Element, str] # Shouldn't crash def Elem(*args): From 9c99df27e34c3fe102518f2f8b83f601f0514edd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Furkan=20=C3=96nder?= Date: Sat, 28 Mar 2020 14:38:43 +0300 Subject: [PATCH 10/10] Delete 2020-03-27-13-29-31.bpo-40086.YNPe8R.rst --- Misc/NEWS.d/next/Tests/2020-03-27-13-29-31.bpo-40086.YNPe8R.rst | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 Misc/NEWS.d/next/Tests/2020-03-27-13-29-31.bpo-40086.YNPe8R.rst diff --git a/Misc/NEWS.d/next/Tests/2020-03-27-13-29-31.bpo-40086.YNPe8R.rst b/Misc/NEWS.d/next/Tests/2020-03-27-13-29-31.bpo-40086.YNPe8R.rst deleted file mode 100644 index 398473cf44c7a2..00000000000000 --- a/Misc/NEWS.d/next/Tests/2020-03-27-13-29-31.bpo-40086.YNPe8R.rst +++ /dev/null @@ -1,2 +0,0 @@ -This test was skipped because cElementTree was deprecated and removed in Python 3 with 36543. So the test case has been updated according to Python 3. -Patch by Furkan Onder