def test_clear_all_cookies(self):
response = self.fetch('/', headers={'Cookie': 'foo=bar; baz=xyzzy'})
set_cookies = sorted(response.headers.get_list('Set-Cookie'))
- self.assertTrue(set_cookies[0].startswith('baz=;'))
- self.assertTrue(set_cookies[1].startswith('foo=;'))
+ # Python 3.5 sends 'baz="";'; older versions use 'baz=;'
+ self.assertTrue(set_cookies[0].startswith('baz=;') or
+ set_cookies[0].startswith('baz="";'))
+ self.assertTrue(set_cookies[1].startswith('foo=;') or
+ set_cookies[1].startswith('foo="";'))
class PermissionError(Exception):
from __future__ import absolute_import, division, print_function, with_statement
import array
-import inspect
import os
import sys
import zlib
except NameError:
xrange = range # py3
+# inspect.getargspec() raises DeprecationWarnings in Python 3.5.
+# The two functions have compatible interfaces for the parts we need.
+try:
+ from inspect import getfullargspec as getargspec # py3
+except ImportError:
+ from inspect import getargspec # py2
+
class ObjectDict(dict):
"""Makes a dictionary behave like an object, with attribute-style access.
def __init__(self, func, name):
self.name = name
try:
- self.arg_pos = inspect.getargspec(func).args.index(self.name)
+ self.arg_pos = getargspec(func).args.index(self.name)
except ValueError:
# Not a positional parameter
self.arg_pos = None