#16152: merge with 3.2.
diff --git a/Lib/test/test_tokenize.py b/Lib/test/test_tokenize.py
index 213e9b4..b4a58f0 100644
--- a/Lib/test/test_tokenize.py
+++ b/Lib/test/test_tokenize.py
@@ -1109,6 +1109,10 @@
                                   token.NAME, token.AMPER, token.NUMBER,
                                   token.RPAR)
 
+    def test_pathological_trailing_whitespace(self):
+        # See http://bugs.python.org/issue16152
+        self.assertExactTypeEqual('@          ', token.AT)
+
 __test__ = {"doctests" : doctests, 'decistmt': decistmt}
 
 def test_main():