From 3a5dd047709bf114b10ae2b739371a59b4eadd884d3b3a0b475ab48184481dfa Mon Sep 17 00:00:00 2001 From: Matej Cepl Date: Thu, 17 Oct 2024 11:08:35 +0000 Subject: [PATCH] More debugging OBS-URL: https://build.opensuse.org/package/show/devel:languages:python:Factory/python314?expand=0&rev=14 --- fix_test_ftp_error.patch | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/fix_test_ftp_error.patch b/fix_test_ftp_error.patch index 178fb5b..721f118 100644 --- a/fix_test_ftp_error.patch +++ b/fix_test_ftp_error.patch @@ -1,10 +1,36 @@ --- - Lib/test/test_urllib2.py | 1 + - 1 file changed, 1 insertion(+) + Lib/test/test_urllib2.py | 9 +++++++++ + 1 file changed, 9 insertions(+) --- a/Lib/test/test_urllib2.py +++ b/Lib/test/test_urllib2.py -@@ -794,6 +794,7 @@ class HandlerTests(unittest.TestCase): +@@ -1,3 +1,4 @@ ++import logging + import unittest + from test import support + from test.support import os_helper +@@ -29,6 +30,10 @@ import http.client + + support.requires_working_socket(module=True) + ++logging.basicConfig(format='%(levelname)s:%(funcName)s:%(message)s', ++ level=logging.DEBUG) ++log = logging.getLogger() ++ + # XXX + # Request + # CacheFTPHandler (hard to write) +@@ -731,6 +736,9 @@ def sanepathname2url(path): + + class HandlerTests(unittest.TestCase): + ++ def setUp(self): ++ log.debug('Is network available: {}'.format(support.is_resource_enabled('network'))) ++ + def test_ftp(self): + class MockFTPWrapper: + def __init__(self, data): +@@ -794,6 +802,7 @@ class HandlerTests(unittest.TestCase): self.assertEqual(headers.get("Content-type"), mimetype) self.assertEqual(int(headers["Content-length"]), len(data))