diff --git a/doubles/call_count_accumulator.py b/doubles/call_count_accumulator.py index 6f65f38..3c8f400 100644 --- a/doubles/call_count_accumulator.py +++ b/doubles/call_count_accumulator.py @@ -154,7 +154,7 @@ def error_string(self): if self.has_correct_call_count(): return '' - return '{} but was called {} {} '.format( + return '{} instead of {} {} '.format( self._restriction_string(), self.count, pluralize('time', self.count) diff --git a/test/allow_test.py b/test/allow_test.py index fccc865..15561e4 100644 --- a/test/allow_test.py +++ b/test/allow_test.py @@ -217,7 +217,7 @@ def test_fails_when_called_three_times(self): teardown() assert re.match( - r"Allowed 'instance_method' to be called 2 times but was called 3 times on " + r"Allowed 'instance_method' to be called 2 times instead of 3 times on " r" object at .+> " r"with any args, but was not." r" \(.*doubles/test/allow_test.py:\d+\)", @@ -244,7 +244,7 @@ def test_fails_when_called_two_times(self): teardown() assert re.match( - r"Allowed 'instance_method' to be called 1 time but was called 2 times on " + r"Allowed 'instance_method' to be called 1 time instead of 2 times on " r" object at .+> " r"with any args, but was not." r" \(.*doubles/test/allow_test.py:\d+\)", @@ -268,7 +268,7 @@ def test_fails_when_called_once_times(self): teardown() assert re.match( - r"Allowed 'instance_method' to be called 0 times but was called 1 " + r"Allowed 'instance_method' to be called 0 times instead of 1 " r"time on " r"object at .+> with any args, but was not." r" \(.*doubles/test/allow_test.py:\d+\)", @@ -299,7 +299,7 @@ def test_called_with_zero(self): teardown() assert re.match( - r"Allowed 'instance_method' to be called 0 times but was called 1 " + r"Allowed 'instance_method' to be called 0 times instead of 1 " r"time on " r"object at .+> with any args, but was not." r" \(.*doubles/test/allow_test.py:\d+\)", @@ -339,7 +339,7 @@ def test_fails_when_called_more_than_expected_times(self): teardown() assert re.match( - r"Allowed 'instance_method' to be called 1 time but was called 2 times on " + r"Allowed 'instance_method' to be called 1 time instead of 2 times on " r" object at .+> " r"with any args, but was not." r" \(.*doubles/test/allow_test.py:\d+\)", @@ -447,7 +447,7 @@ def test_fails_when_called_more_than_at_most_times(self): teardown() assert re.match( - r"Allowed 'instance_method' to be called at most 1 time but was called 2 times on " + r"Allowed 'instance_method' to be called at most 1 time instead of 2 times on " r" object at .+> " r"with any args, but was not." r" \(.*doubles/test/allow_test.py:\d+\)", diff --git a/test/expect_test.py b/test/expect_test.py index 673a65f..bd598e3 100644 --- a/test/expect_test.py +++ b/test/expect_test.py @@ -126,7 +126,7 @@ def test_fails_when_called_once(self): teardown() assert re.match( - r"Expected 'instance_method' to be called 2 times but was called 1 time on " + r"Expected 'instance_method' to be called 2 times instead of 1 time on " r" object at .+> " r"with any args, but was not." r" \(.*doubles/test/expect_test.py:\d+\)", @@ -145,7 +145,7 @@ def test_fails_when_called_three_times(self): teardown() assert re.match( - r"Expected 'instance_method' to be called 2 times but was called 3 times on " + r"Expected 'instance_method' to be called 2 times instead of 3 times on " r" object at .+> " r"with any args, but was not." r" \(.*doubles/test/expect_test.py:\d+\)", @@ -172,7 +172,7 @@ def test_fails_when_called_two_times(self): teardown() assert re.match( - r"Expected 'instance_method' to be called 1 time but was called 2 times on " + r"Expected 'instance_method' to be called 1 time instead of 2 times on " r" object at .+> " r"with any args, but was not." r" \(.*doubles/test/expect_test.py:\d+\)", @@ -207,7 +207,7 @@ def test_fails_when_called_less_than_expected_times(self): teardown() assert re.match( - r"Expected 'instance_method' to be called 2 times but was called 1 time on " + r"Expected 'instance_method' to be called 2 times instead of 1 time on " r" object at .+> " r"with any args, but was not." r" \(.*doubles/test/expect_test.py:\d+\)", @@ -232,7 +232,7 @@ def test_fails_when_called_more_than_expected_times(self): teardown() assert re.match( - r"Expected 'instance_method' to be called 1 time but was called 2 times on " + r"Expected 'instance_method' to be called 1 time instead of 2 times on " r" object at .+> " r"with any args, but was not." r" \(.*doubles/test/expect_test.py:\d+\)", @@ -259,7 +259,7 @@ def test_fails_when_called_less_than_at_least_times(self): teardown() assert re.match( - r"Expected 'instance_method' to be called at least 2 times but was called 1 time on " + r"Expected 'instance_method' to be called at least 2 times instead of 1 time on " r" object at .+> " r"with any args, but was not." r" \(.*doubles/test/expect_test.py:\d+\)", @@ -317,7 +317,7 @@ def test_fails_when_called_more_than_at_most_times(self): teardown() assert re.match( - r"Expected 'instance_method' to be called at most 1 time but was called 2 times on " + r"Expected 'instance_method' to be called at most 1 time instead of 2 times on " r" object at .+> " r"with any args, but was not." r" \(.*doubles/test/expect_test.py:\d+\)", @@ -343,7 +343,7 @@ def test_unsatisfied_expectation(self): teardown() assert re.match( - r"Expected '__call__' to be called 1 time but was called 0 times on " + r"Expected '__call__' to be called 1 time instead of 0 times on " r" object at .+> " r"with any args, but was not." r" \(.*doubles/test/expect_test.py:\d+\)", @@ -371,7 +371,7 @@ def test_unsatisfied_expectation(self): teardown() assert re.match( - r"Expected '__enter__' to be called 1 time but was called 0 times on " + r"Expected '__enter__' to be called 1 time instead of 0 times on " r" object at .+> " r"with any args, but was not." r" \(.*doubles/test/expect_test.py:\d+\)", @@ -399,7 +399,7 @@ def test_unsatisfied_expectation(self): teardown() assert re.match( - r"Expected '__exit__' to be called 1 time but was called 0 times on " + r"Expected '__exit__' to be called 1 time instead of 0 times on " r" object at .+> " r"with any args, but was not." r" \(.*doubles/test/expect_test.py:\d+\)", diff --git a/test/pytest_test.py b/test/pytest_test.py index d87a108..e1762f7 100644 --- a/test/pytest_test.py +++ b/test/pytest_test.py @@ -38,7 +38,7 @@ def test_that_should_fail_for_not_satisfying_expection(): outcomes = result.parseoutcomes() assert outcomes['error'] == 2 expected_error = ( - "*Expected 'class_method' to be called 1 time but was called 0 times on" + "*Expected 'class_method' to be called 1 time instead of 0 times on" " with ('{arg_value}')*" ) result.stdout.fnmatch_lines([expected_error.format(arg_value="test_one")])