Question

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?

Was it helpful?

Solution

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.

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top