Browse Source

Prevent fortunes output being accumulated across tests by the verifier (#3420)

It makes sense to me why it was doing what it did - it was accumulating
the fortunes output into a static class-level variable - and it makes
sense why this change fixes that problem.  What doesn't make sense is
why this problem is new.  How did it ever work?
Michael Hixson 7 years ago
parent
commit
6c42b8f510
1 changed files with 4 additions and 1 deletions
  1. 4 1
      toolset/benchmark/fortune_html_parser.py

+ 4 - 1
toolset/benchmark/fortune_html_parser.py

@@ -4,7 +4,10 @@ from difflib import unified_diff
 
 
 class FortuneHTMLParser(HTMLParser):
-    body = []
+
+    def __init__(self):
+        HTMLParser.__init__(self)
+        self.body = []
 
     valid_fortune = '''<!doctype html><html>
 <head><title>Fortunes</title></head>