Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/py/, dev-python/py/files/
Date: Sat, 16 Nov 2019 10:32:17
Message-Id: 1573900325.8adae0adfb260a00f800716fda547f89222e17fc.mgorny@gentoo
1 commit: 8adae0adfb260a00f800716fda547f89222e17fc
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Sat Nov 16 10:27:26 2019 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Sat Nov 16 10:32:05 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8adae0ad
7
8 dev-python/py: Bump to 1.8.0
9
10 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
11
12 dev-python/py/Manifest | 1 +
13 dev-python/py/files/py-1.8.0-pytest-4.patch | 580 ++++++++++++++++++++++++++++
14 dev-python/py/py-1.8.0.ebuild | 47 +++
15 3 files changed, 628 insertions(+)
16
17 diff --git a/dev-python/py/Manifest b/dev-python/py/Manifest
18 index 1cf51805ac2..d35ecdba49e 100644
19 --- a/dev-python/py/Manifest
20 +++ b/dev-python/py/Manifest
21 @@ -3,3 +3,4 @@ DIST py-1.4.34.tar.gz 194450 BLAKE2B 3e5733bb53d4f7eb8e6d43a5140f2ddf692d4272b56
22 DIST py-1.5.2.tar.gz 189542 BLAKE2B f0c5995121492ebca7bab9e73b7db61edf014be8e7d76822c72ded9ea19dd647dc0a83cbbcbf732c4ddae9070126cecb00958b623ca43d2219b7be8519b5b58e SHA512 ad92110d56caba2be44c6759350b05ceb882165ad0f58e6cce8361273be874b20b01856d685b142a83edff77b41bcce2911cf5797db5253b4f3e9b36e703c07d
23 DIST py-1.5.3.tar.gz 202335 BLAKE2B 6a7ef206bddd641cb5e2fe04966ae93db96a7ff757fcde604f8fd2d36c4a03ce5955c2f445a866dd5cd83026ab2a9fa17feeb0da0df3d40d9746c19d865f6325 SHA512 243c0da94c439163257c525ef00b30fd6d8add5897121ee0b1f19476b50f18823ce2b99a5ab27a9cf47598b538758d0534060123dce0820d2a65d98046548c96
24 DIST py-1.5.4.tar.gz 201448 BLAKE2B 3d9f71ba53c8004d4745be984e0a3b81c98f38fdcd7703c39286c53bb167a803aa92b3b0897e407f6ee98d2b870838a27b507ad8e6cceab7b22c8e7229bb6581 SHA512 45424b133be3e78ccab48e74daa6ca6a76fca283bd3a51d50c91e911c509a2c45de4fcc7c8c15f33620d61ee16dfc3969fdd78d8839e96f52897e97b1ad624c4
25 +DIST py-1.8.0.tar.gz 205096 BLAKE2B e08554fc3e0bae2e2d4515f075991707af29aa5c39e1387e8f8a7dab25e78c7340d389c79936ddea27b1fb0438ebdee8b5e218bbb48c62089d7fb656b1b6dbe8 SHA512 37b9a66229b834a034d9ba6769a46addf098380b494c1eb863607a52d00b7ec5b9157dd7ac6ffc52535a05006648c775c78716d7f85cf44966065b225be6e95b
26
27 diff --git a/dev-python/py/files/py-1.8.0-pytest-4.patch b/dev-python/py/files/py-1.8.0-pytest-4.patch
28 new file mode 100644
29 index 00000000000..d9d5cfa5b65
30 --- /dev/null
31 +++ b/dev-python/py/files/py-1.8.0-pytest-4.patch
32 @@ -0,0 +1,580 @@
33 +From f4ed62ad39f289d09b3efdfed7305f935ce60bfc Mon Sep 17 00:00:00 2001
34 +From: Stanislav Levin <slev@××××××××.org>
35 +Date: Tue, 4 Jun 2019 14:33:36 +0300
36 +Subject: [PATCH] Fix Pytest4.x compatibility errors
37 +
38 +This patch should fix such errors/warnings as:
39 +
40 +- raises / warns with a string as the second argument
41 +Deprecated since version 4.1.
42 +
43 +- pytest_funcarg__ prefix
44 +Removed in version 4.0.
45 +
46 +- getfuncargvalue
47 +
48 +- Metafunc.addcall
49 +Removed in version 4.0.
50 +
51 +Fixes: https://github.com/pytest-dev/py/issues/209
52 +Signed-off-by: Stanislav Levin <slev@××××××××.org>
53 +---
54 + doc/faq.txt | 14 -------------
55 + testing/code/test_assertion.py | 9 +++------
56 + testing/code/test_code.py | 3 ++-
57 + testing/code/test_excinfo.py | 12 ++++++-----
58 + testing/code/test_source.py | 18 ++++++++---------
59 + testing/io_/test_capture.py | 15 +++++++++-----
60 + testing/io_/test_terminalwriter.py | 17 ++++++++--------
61 + testing/io_/test_terminalwriter_linewidth.py | 6 ++++++
62 + testing/log/test_log.py | 6 ++++--
63 + testing/path/common.py | 7 ++++---
64 + testing/path/conftest.py | 16 +++++++--------
65 + testing/path/test_cacheutil.py | 6 ++++--
66 + testing/path/test_svnauth.py | 6 ++++--
67 + testing/path/test_svnurl.py | 21 +++++++++++++-------
68 + testing/path/test_svnwc.py | 17 ++++++++++------
69 + testing/root/test_builtin.py | 6 ++++--
70 + testing/root/test_std.py | 3 ++-
71 + 17 files changed, 100 insertions(+), 82 deletions(-)
72 +
73 +diff --git a/doc/faq.txt b/doc/faq.txt
74 +index 52cb4b3f..cac83b2c 100644
75 +--- a/doc/faq.txt
76 ++++ b/doc/faq.txt
77 +@@ -98,20 +98,6 @@ in a managed class/module/function scope.
78 + .. _`xUnit style setup`: test/xunit_setup.html
79 + .. _`pytest_nose`: test/plugin/nose.html
80 +
81 +-.. _`why pytest_pyfuncarg__ methods?`:
82 +-
83 +-Why the ``pytest_funcarg__*`` name for funcarg factories?
84 +----------------------------------------------------------------
85 +-
86 +-When experimenting with funcargs an explicit registration mechanism
87 +-was considered. But lacking a good use case for this indirection and
88 +-flexibility we decided to go for `Convention over Configuration`_ and
89 +-allow to directly specify the factory. Besides removing the need
90 +-for an indirection it allows to "grep" for ``pytest_funcarg__MYARG``
91 +-and will safely find all factory functions for the ``MYARG`` function
92 +-argument. It helps to alleviate the de-coupling of function
93 +-argument usage and creation.
94 +-
95 + .. _`Convention over Configuration`: http://en.wikipedia.org/wiki/Convention_over_Configuration
96 +
97 + Can I yield multiple values from a factory function?
98 +diff --git a/testing/code/test_assertion.py b/testing/code/test_assertion.py
99 +index e2a7f903..4cb39fe2 100644
100 +--- a/testing/code/test_assertion.py
101 ++++ b/testing/code/test_assertion.py
102 +@@ -18,15 +18,12 @@ def test_assert():
103 +
104 +
105 + def test_assert_within_finally():
106 +- excinfo = py.test.raises(ZeroDivisionError, """
107 ++ with py.test.raises(ZeroDivisionError,
108 ++ match=".*division.* by zero"):
109 + try:
110 +- 1/0
111 ++ 1 / 0
112 + finally:
113 + i = 42
114 +- """)
115 +- s = excinfo.exconly()
116 +- assert re.search("ZeroDivisionError:.*division", s) is not None
117 +-
118 +
119 + def test_assert_multiline_1():
120 + try:
121 +diff --git a/testing/code/test_code.py b/testing/code/test_code.py
122 +index 28ec628b..65328bb7 100644
123 +--- a/testing/code/test_code.py
124 ++++ b/testing/code/test_code.py
125 +@@ -18,7 +18,8 @@ def test_code_gives_back_name_for_not_existing_file():
126 + def test_code_with_class():
127 + class A:
128 + pass
129 +- py.test.raises(TypeError, "py.code.Code(A)")
130 ++ with py.test.raises(TypeError):
131 ++ py.code.Code(A)
132 +
133 + if True:
134 + def x():
135 +diff --git a/testing/code/test_excinfo.py b/testing/code/test_excinfo.py
136 +index c148ab8c..05ec3d9c 100644
137 +--- a/testing/code/test_excinfo.py
138 ++++ b/testing/code/test_excinfo.py
139 +@@ -145,7 +145,8 @@ def test_traceback_cut(self):
140 +
141 + def test_traceback_cut_excludepath(self, testdir):
142 + p = testdir.makepyfile("def f(): raise ValueError")
143 +- excinfo = py.test.raises(ValueError, "p.pyimport().f()")
144 ++ with py.test.raises(ValueError) as excinfo:
145 ++ p.pyimport().f()
146 + basedir = py.path.local(py.test.__file__).dirpath()
147 + newtraceback = excinfo.traceback.cut(excludepath=basedir)
148 + for x in newtraceback:
149 +@@ -273,8 +274,8 @@ def test_tbentry_reinterpret():
150 + def test_excinfo_exconly():
151 + excinfo = py.test.raises(ValueError, h)
152 + assert excinfo.exconly().startswith('ValueError')
153 +- excinfo = py.test.raises(ValueError,
154 +- "raise ValueError('hello\\nworld')")
155 ++ with py.test.raises(ValueError) as excinfo:
156 ++ raise ValueError('hello\\nworld')
157 + msg = excinfo.exconly(tryshort=True)
158 + assert msg.startswith('ValueError')
159 + assert msg.endswith("world")
160 +@@ -350,10 +351,11 @@ def test_codepath_Queue_example():
161 +
162 +
163 + class TestFormattedExcinfo:
164 +- def pytest_funcarg__importasmod(self, request):
165 ++ @pytest.fixture
166 ++ def importasmod(self, request):
167 + def importasmod(source):
168 + source = py.code.Source(source)
169 +- tmpdir = request.getfuncargvalue("tmpdir")
170 ++ tmpdir = request.getfixturevalue("tmpdir")
171 + modpath = tmpdir.join("mod.py")
172 + tmpdir.ensure("__init__.py")
173 + modpath.write(source)
174 +diff --git a/testing/code/test_source.py b/testing/code/test_source.py
175 +index 3492761a..676dcb0a 100644
176 +--- a/testing/code/test_source.py
177 ++++ b/testing/code/test_source.py
178 +@@ -272,7 +272,8 @@ def test_compile_and_getsource(self):
179 + co = self.source.compile()
180 + py.builtin.exec_(co, globals())
181 + f(7)
182 +- excinfo = py.test.raises(AssertionError, "f(6)")
183 ++ with py.test.raises(AssertionError) as excinfo:
184 ++ f(6)
185 + frame = excinfo.traceback[-1].frame
186 + stmt = frame.code.fullsource.getstatement(frame.lineno)
187 + #print "block", str(block)
188 +@@ -326,14 +327,13 @@ def __init__(self, *args):
189 +
190 + def test_getline_finally():
191 + def c(): pass
192 +- excinfo = py.test.raises(TypeError, """
193 +- teardown = None
194 +- try:
195 +- c(1)
196 +- finally:
197 +- if teardown:
198 +- teardown()
199 +- """)
200 ++ with py.test.raises(TypeError) as excinfo:
201 ++ teardown = None
202 ++ try:
203 ++ c(1)
204 ++ finally:
205 ++ if teardown:
206 ++ teardown()
207 + source = excinfo.traceback[-1].statement
208 + assert str(source).strip() == 'c(1)'
209 +
210 +diff --git a/testing/io_/test_capture.py b/testing/io_/test_capture.py
211 +index b5fedd0a..652c8b7f 100644
212 +--- a/testing/io_/test_capture.py
213 ++++ b/testing/io_/test_capture.py
214 +@@ -1,6 +1,7 @@
215 + from __future__ import with_statement
216 +
217 + import os, sys
218 ++import pytest
219 + import py
220 +
221 + needsdup = py.test.mark.skipif("not hasattr(os, 'dup')")
222 +@@ -45,7 +46,8 @@ def test_unicode_and_str_mixture(self):
223 + f = py.io.TextIO()
224 + if sys.version_info >= (3,0):
225 + f.write("\u00f6")
226 +- py.test.raises(TypeError, "f.write(bytes('hello', 'UTF-8'))")
227 ++ with py.test.raises(TypeError):
228 ++ f.write(bytes('hello', 'UTF-8'))
229 + else:
230 + f.write(unicode("\u00f6", 'UTF-8'))
231 + f.write("hello") # bytes
232 +@@ -56,7 +58,8 @@ def test_unicode_and_str_mixture(self):
233 + def test_bytes_io():
234 + f = py.io.BytesIO()
235 + f.write(tobytes("hello"))
236 +- py.test.raises(TypeError, "f.write(totext('hello'))")
237 ++ with py.test.raises(TypeError):
238 ++ f.write(totext('hello'))
239 + s = f.getvalue()
240 + assert s == tobytes("hello")
241 +
242 +@@ -70,8 +73,9 @@ def test_dontreadfrominput():
243 + py.test.raises(ValueError, f.fileno)
244 + f.close() # just for completeness
245 +
246 +-def pytest_funcarg__tmpfile(request):
247 +- testdir = request.getfuncargvalue("testdir")
248 ++@××××××.fixture
249 ++def tmpfile(request):
250 ++ testdir = request.getfixturevalue("testdir")
251 + f = testdir.makepyfile("").open('wb+')
252 + request.addfinalizer(f.close)
253 + return f
254 +@@ -315,7 +319,8 @@ def test_stdin_nulled_by_default(self):
255 + print ("XXX which indicates an error in the underlying capturing")
256 + print ("XXX mechanisms")
257 + cap = self.getcapture()
258 +- py.test.raises(IOError, "sys.stdin.read()")
259 ++ with py.test.raises(IOError):
260 ++ sys.stdin.read()
261 + out, err = cap.reset()
262 +
263 + def test_suspend_resume(self):
264 +diff --git a/testing/io_/test_terminalwriter.py b/testing/io_/test_terminalwriter.py
265 +index 1eef7f7d..2953dfff 100644
266 +--- a/testing/io_/test_terminalwriter.py
267 ++++ b/testing/io_/test_terminalwriter.py
268 +@@ -107,14 +107,11 @@ def test_unicode_on_file_with_ascii_encoding(tmpdir, monkeypatch, encoding):
269 +
270 + win32 = int(sys.platform == "win32")
271 + class TestTerminalWriter:
272 +- def pytest_generate_tests(self, metafunc):
273 +- if "tw" in metafunc.funcargnames:
274 +- metafunc.addcall(id="path", param="path")
275 +- metafunc.addcall(id="stringio", param="stringio")
276 +- metafunc.addcall(id="callable", param="callable")
277 +- def pytest_funcarg__tw(self, request):
278 ++
279 ++ @pytest.fixture(params=["path", "stringio", "callable"])
280 ++ def tw(self, request):
281 + if request.param == "path":
282 +- tmpdir = request.getfuncargvalue("tmpdir")
283 ++ tmpdir = request.getfixturevalue("tmpdir")
284 + p = tmpdir.join("tmpfile")
285 + f = codecs.open(str(p), 'w+', encoding='utf8')
286 + tw = py.io.TerminalWriter(f)
287 +@@ -182,8 +179,10 @@ def test_markup(self, tw):
288 + for color in ("red", "green"):
289 + text2 = tw.markup("hello", **{color: True, 'bold': bold})
290 + assert text2.find("hello") != -1
291 +- py.test.raises(ValueError, "tw.markup('x', wronkw=3)")
292 +- py.test.raises(ValueError, "tw.markup('x', wronkw=0)")
293 ++ with py.test.raises(ValueError):
294 ++ tw.markup('x', wronkw=3)
295 ++ with py.test.raises(ValueError):
296 ++ tw.markup('x', wronkw=0)
297 +
298 + def test_line_write_markup(self, tw):
299 + tw.hasmarkup = True
300 +diff --git a/testing/io_/test_terminalwriter_linewidth.py b/testing/io_/test_terminalwriter_linewidth.py
301 +index e6d84fbf..1fe2810e 100644
302 +--- a/testing/io_/test_terminalwriter_linewidth.py
303 ++++ b/testing/io_/test_terminalwriter_linewidth.py
304 +@@ -1,6 +1,8 @@
305 + # coding: utf-8
306 + from __future__ import unicode_literals
307 +
308 ++import pytest
309 ++
310 + from py._io.terminalwriter import TerminalWriter
311 +
312 +
313 +@@ -31,6 +33,10 @@ def test_terminal_writer_line_width_update_with_wide_text():
314 + assert tw.width_of_current_line == 21 # 5*2 + 1 + 5*2
315 +
316 +
317 ++@×××××××××××.skipif(
318 ++ 'sys.version_info > (3,)',
319 ++ reason='Bytes are not accepted'
320 ++ ' https://github.com/pytest-dev/pytest/issues/4861')
321 + def test_terminal_writer_line_width_update_with_wide_bytes():
322 + tw = TerminalWriter()
323 + tw.write('乇乂ㄒ尺卂 ㄒ卄丨匚匚'.encode('utf-8'))
324 +diff --git a/testing/log/test_log.py b/testing/log/test_log.py
325 +index 5c706d9b..ebf12705 100644
326 +--- a/testing/log/test_log.py
327 ++++ b/testing/log/test_log.py
328 +@@ -89,8 +89,10 @@ def test_simple_consumer_match_2(self):
329 +
330 + def test_no_auto_producer(self):
331 + p = py.log.Producer('x')
332 +- py.test.raises(AttributeError, "p._x")
333 +- py.test.raises(AttributeError, "p.x_y")
334 ++ with py.test.raises(AttributeError):
335 ++ p._x
336 ++ with py.test.raises(AttributeError):
337 ++ p.x_y
338 +
339 + def test_setconsumer_with_producer(self):
340 + l = []
341 +diff --git a/testing/path/common.py b/testing/path/common.py
342 +index d69a1c39..14558222 100644
343 +--- a/testing/path/common.py
344 ++++ b/testing/path/common.py
345 +@@ -155,8 +155,8 @@ def test_listdir(self, path1):
346 + l = path1.listdir()
347 + assert path1.join('sampledir') in l
348 + assert path1.join('samplefile') in l
349 +- py.test.raises(py.error.ENOTDIR,
350 +- "path1.join('samplefile').listdir()")
351 ++ with py.test.raises(py.error.ENOTDIR):
352 ++ path1.join('samplefile').listdir()
353 +
354 + def test_listdir_fnmatchstring(self, path1):
355 + l = path1.listdir('s*dir')
356 +@@ -300,7 +300,8 @@ def test_mtime(self, path1):
357 + assert url.mtime() > 0
358 +
359 + def test_relto_wrong_type(self, path1):
360 +- py.test.raises(TypeError, "path1.relto(42)")
361 ++ with py.test.raises(TypeError):
362 ++ path1.relto(42)
363 +
364 + def test_load(self, path1):
365 + p = path1.join('samplepickle')
366 +diff --git a/testing/path/conftest.py b/testing/path/conftest.py
367 +index 84fb5c82..015bd039 100644
368 +--- a/testing/path/conftest.py
369 ++++ b/testing/path/conftest.py
370 +@@ -1,20 +1,19 @@
371 + import py
372 + import sys
373 ++import pytest
374 + from py._path import svnwc as svncommon
375 +
376 + svnbin = py.path.local.sysfind('svn')
377 + repodump = py.path.local(__file__).dirpath('repotest.dump')
378 + from py.builtin import print_
379 +
380 +-def pytest_funcarg__repowc1(request):
381 ++@××××××.fixture
382 ++def repowc1(request):
383 + if svnbin is None:
384 + py.test.skip("svn binary not found")
385 +
386 +- tmpdir = request.getfuncargvalue("tmpdir")
387 +- repo, repourl, wc = request.cached_setup(
388 +- setup=lambda: getrepowc(tmpdir, "path1repo", "path1wc"),
389 +- scope="module",
390 +- )
391 ++ tmpdir = request.getfixturevalue("tmpdir")
392 ++ repo, repourl, wc = getrepowc(tmpdir, "path1repo", "path1wc")
393 + for x in ('test_remove', 'test_move', 'test_status_deleted'):
394 + if request.function.__name__.startswith(x):
395 + #print >>sys.stderr, ("saving repo", repo, "for", request.function)
396 +@@ -22,8 +21,9 @@ def pytest_funcarg__repowc1(request):
397 + request.addfinalizer(lambda: restore_repowc(_savedrepowc))
398 + return repo, repourl, wc
399 +
400 +-def pytest_funcarg__repowc2(request):
401 +- tmpdir = request.getfuncargvalue("tmpdir")
402 ++@××××××.fixture
403 ++def repowc2(request):
404 ++ tmpdir = request.getfixturevalue("tmpdir")
405 + name = request.function.__name__
406 + repo, url, wc = getrepowc(tmpdir, "%s-repo-2" % name, "%s-wc-2" % name)
407 + return repo, url, wc
408 +diff --git a/testing/path/test_cacheutil.py b/testing/path/test_cacheutil.py
409 +index c9fc0746..76023a04 100644
410 +--- a/testing/path/test_cacheutil.py
411 ++++ b/testing/path/test_cacheutil.py
412 +@@ -12,12 +12,14 @@ def test_getorbuild(self):
413 + assert val == 42
414 +
415 + def test_cache_get_key_error(self):
416 +- pytest.raises(KeyError, "self.cache._getentry(-23)")
417 ++ with pytest.raises(KeyError):
418 ++ self.cache._getentry(-23)
419 +
420 + def test_delentry_non_raising(self):
421 + self.cache.getorbuild(100, lambda: 100)
422 + self.cache.delentry(100)
423 +- pytest.raises(KeyError, "self.cache._getentry(100)")
424 ++ with pytest.raises(KeyError):
425 ++ self.cache._getentry(100)
426 +
427 + def test_delentry_raising(self):
428 + self.cache.getorbuild(100, lambda: 100)
429 +diff --git a/testing/path/test_svnauth.py b/testing/path/test_svnauth.py
430 +index 654f0332..d24028dd 100644
431 +--- a/testing/path/test_svnauth.py
432 ++++ b/testing/path/test_svnauth.py
433 +@@ -2,6 +2,7 @@
434 + from py.path import SvnAuth
435 + import time
436 + import sys
437 ++import pytest
438 +
439 + svnbin = py.path.local.sysfind('svn')
440 +
441 +@@ -261,7 +262,8 @@ def test_propget(self):
442 + u.propget('foo')
443 + assert '--username="foo" --password="bar"' in u.commands[0]
444 +
445 +-def pytest_funcarg__setup(request):
446 ++@××××××.fixture
447 ++def setup(request):
448 + return Setup(request)
449 +
450 + class Setup:
451 +@@ -271,7 +273,7 @@ def __init__(self, request):
452 + if not request.config.option.runslowtests:
453 + py.test.skip('use --runslowtests to run these tests')
454 +
455 +- tmpdir = request.getfuncargvalue("tmpdir")
456 ++ tmpdir = request.getfixturevalue("tmpdir")
457 + repodir = tmpdir.join("repo")
458 + py.process.cmdexec('svnadmin create %s' % repodir)
459 + if sys.platform == 'win32':
460 +diff --git a/testing/path/test_svnurl.py b/testing/path/test_svnurl.py
461 +index 15fbea50..7cea4f2b 100644
462 +--- a/testing/path/test_svnurl.py
463 ++++ b/testing/path/test_svnurl.py
464 +@@ -2,10 +2,12 @@
465 + from py._path.svnurl import InfoSvnCommand
466 + import datetime
467 + import time
468 ++import pytest
469 + from svntestbase import CommonSvnTests
470 +
471 +-def pytest_funcarg__path1(request):
472 +- repo, repourl, wc = request.getfuncargvalue("repowc1")
473 ++@××××××.fixture
474 ++def path1(request):
475 ++ repo, repourl, wc = request.getfixturevalue("repowc1")
476 + return py.path.svnurl(repourl)
477 +
478 + class TestSvnURLCommandPath(CommonSvnTests):
479 +@@ -20,10 +22,12 @@ def test_visit_ignore(self, path1):
480 + super(TestSvnURLCommandPath, self).test_visit_ignore(path1)
481 +
482 + def test_svnurl_needs_arg(self, path1):
483 +- py.test.raises(TypeError, "py.path.svnurl()")
484 ++ with py.test.raises(TypeError):
485 ++ py.path.svnurl()
486 +
487 + def test_svnurl_does_not_accept_None_either(self, path1):
488 +- py.test.raises(Exception, "py.path.svnurl(None)")
489 ++ with py.test.raises(Exception):
490 ++ py.path.svnurl(None)
491 +
492 + def test_svnurl_characters_simple(self, path1):
493 + py.path.svnurl("svn+ssh://hello/world")
494 +@@ -32,7 +36,8 @@ def test_svnurl_characters_at_user(self, path1):
495 + py.path.svnurl("http://user@××××.com/some/dir")
496 +
497 + def test_svnurl_characters_at_path(self, path1):
498 +- py.test.raises(ValueError, 'py.path.svnurl("http://host.com/foo@bar")')
499 ++ with py.test.raises(ValueError):
500 ++ py.path.svnurl("http://host.com/foo@bar")
501 +
502 + def test_svnurl_characters_colon_port(self, path1):
503 + py.path.svnurl("http://host.com:8080/some/dir")
504 +@@ -45,7 +50,8 @@ def test_svnurl_characters_colon_path(self, path1):
505 + # colons are allowed on win32, because they're part of the drive
506 + # part of an absolute path... however, they shouldn't be allowed in
507 + # other parts, I think
508 +- py.test.raises(ValueError, 'py.path.svnurl("http://host.com/foo:bar")')
509 ++ with py.test.raises(ValueError):
510 ++ py.path.svnurl("http://host.com/foo:bar")
511 +
512 + def test_export(self, path1, tmpdir):
513 + tmpdir = tmpdir.join("empty")
514 +@@ -92,4 +98,5 @@ def test_svn_1_3_b(self):
515 + assert info.kind == 'dir'
516 +
517 + def test_badchars():
518 +- py.test.raises(ValueError, "py.path.svnurl('http://host/tmp/@@@:')")
519 ++ with py.test.raises(ValueError):
520 ++ py.path.svnurl('http://host/tmp/@@@:')
521 +diff --git a/testing/path/test_svnwc.py b/testing/path/test_svnwc.py
522 +index c643d998..25a3650c 100644
523 +--- a/testing/path/test_svnwc.py
524 ++++ b/testing/path/test_svnwc.py
525 +@@ -30,8 +30,9 @@ def test_make_repo(path1, tmpdir):
526 + rev = wc.commit()
527 + assert rev is None
528 +
529 +-def pytest_funcarg__path1(request):
530 +- repo, repourl, wc = request.getfuncargvalue("repowc1")
531 ++@××××××.fixture
532 ++def path1(request):
533 ++ repo, repourl, wc = request.getfixturevalue("repowc1")
534 + return wc
535 +
536 + class TestWCSvnCommandPath(CommonSvnTests):
537 +@@ -346,7 +347,8 @@ def test_lock_unlock(self, path1):
538 + somefile = root.join('somefile')
539 + somefile.ensure(file=True)
540 + # not yet added to repo
541 +- py.test.raises(Exception, 'somefile.lock()')
542 ++ with py.test.raises(Exception):
543 ++ somefile.lock()
544 + somefile.write('foo')
545 + somefile.commit('test')
546 + assert somefile.check(versioned=True)
547 +@@ -357,13 +359,15 @@ def test_lock_unlock(self, path1):
548 + assert locked[0].basename == somefile.basename
549 + assert locked[0].dirpath().basename == somefile.dirpath().basename
550 + #assert somefile.locked()
551 +- py.test.raises(Exception, 'somefile.lock()')
552 ++ with py.test.raises(Exception):
553 ++ somefile.lock()
554 + finally:
555 + somefile.unlock()
556 + #assert not somefile.locked()
557 + locked = root.status().locked
558 + assert locked == []
559 +- py.test.raises(Exception, 'somefile,unlock()')
560 ++ with py.test.raises(Exception):
561 ++ somefile,unlock()
562 + somefile.remove()
563 +
564 + def test_commit_nonrecursive(self, path1):
565 +@@ -481,7 +485,8 @@ def test_svn_1_3(self, path1):
566 +
567 +
568 + def test_characters_at():
569 +- py.test.raises(ValueError, "py.path.svnwc('/tmp/@@@:')")
570 ++ with py.test.raises(ValueError):
571 ++ py.path.svnwc('/tmp/@@@:')
572 +
573 + def test_characters_tilde():
574 + py.path.svnwc('/tmp/test~')
575 +diff --git a/testing/root/test_builtin.py b/testing/root/test_builtin.py
576 +index 287c60d5..b2881de4 100644
577 +--- a/testing/root/test_builtin.py
578 ++++ b/testing/root/test_builtin.py
579 +@@ -56,7 +56,8 @@ def test_frozenset():
580 +
581 + def test_print_simple():
582 + from py.builtin import print_
583 +- py.test.raises(TypeError, "print_(hello=3)")
584 ++ with py.test.raises(TypeError):
585 ++ print_(hello=3)
586 + f = py.io.TextIO()
587 + print_("hello", "world", file=f)
588 + s = f.getvalue()
589 +@@ -133,7 +134,8 @@ def test_reraise():
590 + raise Exception()
591 + except Exception:
592 + cls, val, tb = sys.exc_info()
593 +- excinfo = py.test.raises(Exception, "_reraise(cls, val, tb)")
594 ++ with py.test.raises(Exception):
595 ++ _reraise(cls, val, tb)
596 +
597 + def test_exec():
598 + l = []
599 +diff --git a/testing/root/test_std.py b/testing/root/test_std.py
600 +index 143556a0..dca0c671 100644
601 +--- a/testing/root/test_std.py
602 ++++ b/testing/root/test_std.py
603 +@@ -6,7 +6,8 @@ def test_os():
604 + assert py.std.os is os
605 +
606 + def test_import_error_converts_to_attributeerror():
607 +- py.test.raises(AttributeError, "py.std.xyzalskdj")
608 ++ with py.test.raises(AttributeError):
609 ++ py.std.xyzalskdj
610 +
611 + def test_std_gets_it():
612 + for x in py.std.sys.modules:
613
614 diff --git a/dev-python/py/py-1.8.0.ebuild b/dev-python/py/py-1.8.0.ebuild
615 new file mode 100644
616 index 00000000000..9093f56873f
617 --- /dev/null
618 +++ b/dev-python/py/py-1.8.0.ebuild
619 @@ -0,0 +1,47 @@
620 +# Copyright 1999-2019 Gentoo Authors
621 +# Distributed under the terms of the GNU General Public License v2
622 +
623 +EAPI=7
624 +
625 +PYTHON_COMPAT=( python2_7 python3_{5,6,7} pypy{,3} )
626 +
627 +inherit distutils-r1
628 +
629 +DESCRIPTION="library with cross-python path, ini-parsing, io, code, log facilities"
630 +HOMEPAGE="https://pylib.readthedocs.io/en/latest/ https://pypi.org/project/py/"
631 +SRC_URI="mirror://pypi/${PN:0:1}/${PN}/${P}.tar.gz"
632 +
633 +LICENSE="MIT"
634 +SLOT="0"
635 +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~x86-linux ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
636 +IUSE="doc"
637 +
638 +BDEPEND="
639 + dev-python/setuptools[${PYTHON_USEDEP}]
640 + dev-python/setuptools_scm[${PYTHON_USEDEP}]
641 + doc? ( dev-python/sphinx )"
642 +
643 +PATCHES=(
644 + "${FILESDIR}"/${PN}-1.5.2-skip-apiwarn-pytest31.patch
645 + "${FILESDIR}"/${P}-pytest-4.patch
646 +)
647 +
648 +distutils_enable_tests pytest
649 +
650 +python_prepare_all() {
651 + sed -e 's:intersphinx_mapping:#&:' -i doc/conf.py || die
652 +
653 + distutils-r1_python_prepare_all
654 +
655 + # broken, and relying on exact assertion strings
656 + rm testing/code/test_assertion.py || die
657 +}
658 +
659 +python_compile_all() {
660 + use doc && emake -C doc html
661 +}
662 +
663 +python_install_all() {
664 + use doc && local HTML_DOCS=( doc/_build/html/. )
665 + distutils-r1_python_install_all
666 +}