Take the 2-minute tour ×

I'm using cherrypy to implement a web server and I use nose to run my unit tests. However, there is a lot of debug noise that nose catches and prints to stdout, even when I use the --nologcapture, particularly cherrypy's logging messages. That makes the testing output quite difficult to read.

I've thought that:

def setUp(self):
   cherrypy.config.update({ "server.logToScreen" : False })
   cherrypy.config.update({'log.screen': False})

together with --nologcapture option would suppress those messages, but apparently it does not.

Anyone knows how to get rid of those messages and have a nice clean test output, please?

share|improve this question

2 Answers 2

up vote 4 down vote accepted

You did not mention which version of CherryPy you were using, but assuming 3.x based on what you are experiencing. I believe you need to add the following config option:

cherrypy.config.update({ "environment": "embedded" })

I was recently faced with the same issue when I was testing a CherryPy app with Twill.

share|improve this answer

I was experiencing this problem with CherryPy 3.1.2. I switched to 3.2.2 and the problem went away without needing any code changes.

share|improve this answer

Your Answer


