Project

General

Profile

Bug #1659

Make tests handle failure to start httpd better

Added by Luke Murphey almost 8 years ago. Updated almost 8 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Unit Tests
Target version:
Start date:
12/19/2016
Due date:
% Done:

100%


Description

  1. The tests will attempt to shutdown the server even though it doesn't exist
  2. The tests don't print a message indicating that the server could not be started
  3. The tests should detect that the server could not be started and generate a message accordingly without actually running

History

#1 Updated by Luke Murphey almost 8 years ago

I can havve tests that skip if the web-server doesn't run using the skipIf decorator: https://docs.python.org/2/library/unittest.html

#2 Updated by Luke Murphey almost 8 years ago

This works under the go account:

import SocketServer
from BaseHTTPServer import BaseHTTPRequestHandler

class Handler(BaseHTTPRequestHandler):
    pass

httpd = SocketServer.TCPServer(("", 8888), Handler)
httpd.serve_forever()

#3 Updated by Luke Murphey almost 8 years ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

Also available in: Atom PDF