Author: Matti Picus <[email protected]>
Branch: py3.6
Changeset: r97142:018380765dc8
Date: 2019-08-10 21:50 +0300
http://bitbucket.org/pypy/pypy/changeset/018380765dc8/

Log:    merge default into brach

diff --git a/pypy/module/_socket/test/test_sock_app.py 
b/pypy/module/_socket/test/test_sock_app.py
--- a/pypy/module/_socket/test/test_sock_app.py
+++ b/pypy/module/_socket/test/test_sock_app.py
@@ -1,5 +1,6 @@
 # -*- coding: utf-8 -*-
 import sys, os
+import socket
 import pytest
 from pypy.tool.pytest.objspace import gettestobjspace
 from pypy.interpreter.gateway import interp2app
@@ -10,8 +11,6 @@
 def setup_module(mod):
     mod.space = gettestobjspace(usemodules=['_socket', 'array', 'struct',
                                             'unicodedata'])
-    global socket
-    import socket
     mod.w_socket = space.appexec([], "(): import _socket as m; return m")
     mod.path = udir.join('fd')
     mod.path.write('fo')
@@ -57,15 +56,11 @@
                         "(_socket, name): return _socket.getservbyname(name, 
'tcp')")
     assert space.unwrap(port) == 25
     # 1 arg version
-    if sys.version_info < (2, 4):
-        pytest.skip("getservbyname second argument is not optional before 
python 2.4")
     port = space.appexec([w_socket, space.wrap(name)],
                         "(_socket, name): return _socket.getservbyname(name)")
     assert space.unwrap(port) == 25
 
 def test_getservbyport():
-    if sys.version_info < (2, 4):
-        pytest.skip("getservbyport does not exist before python 2.4")
     port = 25
     # 2 args version
     name = space.appexec([w_socket, space.wrap(port)],
@@ -90,6 +85,7 @@
                         "(_socket, name): return _socket.getprotobyname(name)")
     assert space.unwrap(w_n) == socket.IPPROTO_TCP
 
[email protected]("not hasattr(socket, 'fromfd')")
 def test_ntohs():
     w_n = space.appexec([w_socket, space.wrap(125)],
                         "(_socket, x): return _socket.ntohs(x)")
@@ -132,9 +128,8 @@
                          "(_socket, p): return _socket.inet_ntoa(p)")
     assert space.utf8_w(w_ip) == ip
 
[email protected]("not hasattr(socket, 'inet_pton')")
 def test_pton_ntop_ipv4():
-    if not hasattr(socket, 'inet_pton'):
-        pytest.skip('No socket.inet_pton on this platform')
     tests = [
         ("123.45.67.89", "\x7b\x2d\x43\x59"),
         ("0.0.0.0", "\x00" * 4),
@@ -191,11 +186,6 @@
             "(_socket, ip): return _socket.inet_pton(_socket.AF_INET6, ip)")
         assert space.unwrap(w_packed) == packed
 
-def test_has_ipv6():
-    pytest.skip("has_ipv6 is always True on PyPy for now")
-    res = space.appexec([w_socket], "(_socket): return _socket.has_ipv6")
-    assert space.unwrap(res) == socket.has_ipv6
-
 def test_getaddrinfo():
     host = b"localhost"
     port = 25
@@ -311,7 +301,7 @@
                                    'unicodedata'])
 
     def setup_class(cls):
-        cls.space = space
+        space = cls.space
         cls.w_udir = space.wrap(str(udir))
 
     def teardown_class(cls):
@@ -762,10 +752,11 @@
         raises(TypeError, s.connect, (domain + '\x00', 80))
 
 
[email protected](not hasattr(os, 'getpid'),
+    reason="AF_NETLINK needs os.getpid()")
 class AppTestNetlink:
     def setup_class(cls):
-        if not hasattr(os, 'getpid'):
-            pytest.skip("AF_NETLINK needs os.getpid()")
+        cls.space = space
 
         if cls.runappdirect:
             import _socket
@@ -775,7 +766,6 @@
                                  "return hasattr(_socket, 'AF_NETLINK')")
         if not space.is_true(w_ok):
             pytest.skip("no AF_NETLINK on this platform")
-        cls.space = space
 
     def test_connect_to_kernel_netlink_routing_socket(self):
         import _socket, os
@@ -788,10 +778,11 @@
         assert b == 0
 
 
[email protected](not hasattr(os, 'getuid') or os.getuid() != 0,
+    reason="AF_PACKET needs to be root for testing")
 class AppTestPacket:
     def setup_class(cls):
-        if not hasattr(os, 'getuid') or os.getuid() != 0:
-            pytest.skip("AF_PACKET needs to be root for testing")
+        cls.space = space
         if cls.runappdirect:
             import _socket
             w_ok = hasattr(_socket, 'AF_PACKET')
@@ -800,7 +791,6 @@
                                  "return hasattr(_socket, 'AF_PACKET')")
         if not space.is_true(w_ok):
             pytest.skip("no AF_PACKET on this platform")
-        cls.space = space
 
     def test_convert_between_tuple_and_sockaddr_ll(self):
         import _socket
diff --git a/testrunner/get_info.py b/testrunner/get_info.py
--- a/testrunner/get_info.py
+++ b/testrunner/get_info.py
@@ -10,7 +10,8 @@
 BASE_DIR = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
 if sys.platform.startswith('win'):
     TARGET_NAME = r'pypy3-c.exe'
-    TARGET_DIR = 'Scripts'
+    # PyPy uses bin as of PR https://github.com/pypa/virtualenv/pull/1400
+    TARGET_DIR = 'bin'
 else:
     TARGET_NAME = 'pypy3-c'
     TARGET_DIR = 'bin'
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to