diff --git a/python 2/runner/runner_tests/test_sensei.py b/python 2/runner/runner_tests/test_sensei.py index 97360da97..102024850 100644 --- a/python 2/runner/runner_tests/test_sensei.py +++ b/python 2/runner/runner_tests/test_sensei.py @@ -7,6 +7,7 @@ from libs.mock import * +from runner.koan import * from runner.sensei import Sensei from runner.writeln_decorator import WritelnDecorator from runner.mockable_test_result import MockableTestResult @@ -297,6 +298,19 @@ def test_that_scraping_the_assertion_error_with_list_error(self): ? ^""", self.sensei.scrapeAssertionError(error_with_list)) + def test_that_scraping_the_assertion_error_will_not_reveal_a_solution(self): + self.assertEqual("", self.sensei.scrapeAssertionError("""Traceback (most recent call last): + File "mock.py", line 106, in test_fail + self.assertTrue(False) + AssertionError: %s is not True + """ % __)) + + self.assertEqual("", self.sensei.scrapeAssertionError("""Traceback (most recent call last): + File "mock.py", line 106, in test_fail + self.assertTrue(False) + AssertionError: %s is not True + """ % ____)) + def test_that_scraping_a_non_existent_stack_dump_gives_you_nothing(self): self.assertEqual("", self.sensei.scrapeInterestingStackDump(None)) diff --git a/python 2/runner/sensei.py b/python 2/runner/sensei.py index 15e2d1325..623eea7b7 100644 --- a/python 2/runner/sensei.py +++ b/python 2/runner/sensei.py @@ -5,6 +5,7 @@ import re import helper +from runner.koan import __, ____ from mockable_test_result import MockableTestResult from libs.colorama import init, Fore, Style @@ -109,6 +110,9 @@ def errorReport(self): def scrapeAssertionError(self, err): if not err: return "" + if __ in err or ____ in err: + return "" + error_text = "" count = 0 for line in err.splitlines():