support running tests under CherryPy or wsgiref