0
일부 데이터를 처리/읽는 클라이언트 및 서버 스크립트가 있습니다.Python 클라이언트 - 서버 스크립트 단위 테스트 오류
내가 PyUnit을 사용하여 단위 테스트를 작성하려고 할 때, 필자가 추론 할 수없는 오류가 발생합니다.
class TestSequenceFunctions(unittest.TestCase):
def setUp(self):
#some set up operations
def testRecieve(self):
s = socket.socket()
s.connect((FEED_SERVER_HOST, FEED_SERVER_PORT))
sock = socket.socket()
#some recieve operations
s.close()
# When i write this code snippet below, i get error: [Errno 98] Address already in use
error. I tried closing 's' socket in tearDown function but still same error raising.
def testAnotherRecieve(self):
sock = socket.socket() # Results ERRNO 98.
요약으로, 내가 유닛 테스트 클래스의 두 번째 소켓을 만들 수 없습니다 :
다음은 관련 코드입니다. 이 오류의 원인은 무엇입니까? close()에 대한 socket docs 보면
이