我喜欢py.test并尝试让远程测试执行功能正常工作,这样我就可以在远程计算机上运行测试了。文档非常少,我对此感到沮丧。任何帮助搞清楚我做错了什么都值得赞赏。这是我在主服务器上的命令行:
c:\Python26\Scripts\py.test --dist=each --tx socket=192.168.1.11:8888 tests\test_guest_install.py
如果我正确阅读了文档,那么应该将脚本推送到远程计算机并运行它。这是另一边的输出:
C:\Users\Dave\Desktop>c:\Python26\python.exe socketserver.py
socket_readline_exec_server-1.2 Entering Accept loop ('0.0.0.0', 8888)
socket_readline_exec_server-1.2 got new connection from 192.168.1.5 30856
reading line
socket_readline_exec_server-1.2 compiled source, executing
============================= test session starts =============================
python: platform win32 -- Python 2.6.4 -- pytest-1.2.0
test object 1: C:\Users\Alan\Desktop\pyexecnetcache
============================== in 0.14 seconds ===============================
socket_readline_exec_server-1.2 finished executing code
leaving socketserver execloop
Traceback (most recent call last):
File "socketserver.py", line 90, in <module>
startserver(serversock, loop=False)
File "socketserver.py", line 81, in startserver
serversock.shutdown(2)
File "<string>", line 1, in shutdown
socket.error: [Errno 10057] A request to send or receive data was disallowed be
ause the socket is not connected and (when sending on a datagram socket using a
sendto call) no address was supplied
答案 0 :(得分:1)
你能尝试重新运行最新版本的pytest和pytest-xdist吗?