diff options
-rwxr-xr-x | cherrypy/test/test_session.py | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/cherrypy/test/test_session.py b/cherrypy/test/test_session.py index a078378e..41b35268 100755 --- a/cherrypy/test/test_session.py +++ b/cherrypy/test/test_session.py @@ -25,8 +25,8 @@ def setup_server(): _cp_config = {'tools.sessions.on': True, 'tools.sessions.storage_type' : 'ram', 'tools.sessions.storage_path' : localDir, - 'tools.sessions.timeout': 0.017, # 1.02 secs - 'tools.sessions.clean_freq': 0.017, + 'tools.sessions.timeout': (1.0 / 60), + 'tools.sessions.clean_freq': (1.0 / 60), } def testGen(self): @@ -89,6 +89,12 @@ from cherrypy.test import helper class SessionTest(helper.CPWebCase): + def tearDown(self): + # Clean up sessions. + for fname in os.listdir(localDir): + if fname.startswith(sessions.FileSession.SESSION_PREFIX): + os.unlink(os.path.join(localDir, fname)) + def test_0_Session(self): self.getPage('/testStr') self.assertBody('1') @@ -109,8 +115,8 @@ class SessionTest(helper.CPWebCase): self.getPage('/delkey?key=counter', self.cookies) self.assertStatus(200) - # Wait for the session.timeout (1.02 secs) - time.sleep(1.25) + # Wait for the session.timeout (1 second) + time.sleep(2) self.getPage('/') self.assertBody('1') |