File: Disable-test-that-requires-local-server.patch

package info (click to toggle)
skimage 0.25.2-2
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 32,668 kB
  • sloc: python: 60,005; cpp: 2,592; ansic: 1,591; xml: 1,342; javascript: 1,267; makefile: 168; sh: 20
file content (57 lines) | stat: -rw-r--r-- 2,370 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
From: Ole Streicher <olebole@debian.org>
Date: Thu, 20 Jun 2024 17:58:40 +0200
Subject: Disable test that requires local server

While the required package (python3-pytest-localserver) is available
on Debian, this test fails during the startup of the localserver:

```
skimage/io/_io.py:47: in imread
    with file_or_url_context(fname) as fname:
/usr/lib/python3.8/contextlib.py:113: in __enter__
    return next(self.gen)
skimage/io/util.py:28: in file_or_url_context
    u = urllib.request.urlopen(resource_name)
/usr/lib/python3.8/urllib/request.py:222: in urlopen
    return opener.open(url, data, timeout)
/usr/lib/python3.8/urllib/request.py:525: in open
    response = self._open(req, data)
/usr/lib/python3.8/urllib/request.py:542: in _open
    result = self._call_chain(self.handle_open, protocol, protocol +
/usr/lib/python3.8/urllib/request.py:502: in _call_chain
    result = func(*args)
/usr/lib/python3.8/urllib/request.py:1348: in http_open
    return self.do_open(http.client.HTTPConnection, req)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <urllib.request.HTTPHandler object at 0x7fabb4e020a0>
http_class = <class 'http.client.HTTPConnection'>
req = <urllib.request.Request object at 0x7fabb463b0d0>, http_conn_args = {}
host = '127.0.0.1:9', h = <http.client.HTTPConnection object at 0x7fabb463b2b0>

    def do_open(self, http_class, req, **http_conn_args):
        [...]
        try:
            try:
                h.request(req.get_method(), req.selector, req.data, headers,
                          encode_chunked=req.has_header('Transfer-encoding'))
            except OSError as err: # timeout error
>               raise URLError(err)
E               urllib.error.URLError: <urlopen error [Errno 111] Connection refused>
```
---
 skimage/io/tests/test_io.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/skimage/io/tests/test_io.py b/skimage/io/tests/test_io.py
index d76499a..b6fc5af 100644
--- a/skimage/io/tests/test_io.py
+++ b/skimage/io/tests/test_io.py
@@ -48,6 +48,7 @@ def test_imread_file_url():
     assert image.shape == (512, 512)
 
 
+@pytest.mark.xfail(reason="Local server does not run at build time")
 @pytest.mark.skipif(is_wasm, reason="no access to pytest-localserver")
 def test_imread_http_url(httpserver):
     # httpserver is a fixture provided by pytest-localserver