我正在尝试用selenium编写测试,我使用的是ChannelsLiveServerTestCase。我需要设置服务器侦听的端口。
发布于 2021-06-21 10:22:59
我想这应该是很少见的情况,因为没有人回答问题,所以需要有人设置端口。无论如何,我不得不深入研究达芙妮的源代码。在testing.py文件中查找行
endpoints = build_endpoint_description_strings(host=self.host, port=0)
在我的示例中,它是第139行,并将其改为
endpoints = build_endpoint_description_strings(host=self.host, port=WHICHEVER_PORT_YOU_WANT)
https://stackoverflow.com/questions/67949920
复制相似问题