bpo-35500: align expected and actual calls on mock.assert_called_with… · python/cpython@2bdd585 (original) (raw)

`@@ -724,7 +724,7 @@ def test_baseexceptional_side_effect(self):

`

724

724

``

725

725

`def test_assert_called_with_message(self):

`

726

726

`mock = Mock()

`

727

``

`-

self.assertRaisesRegex(AssertionError, 'Not called',

`

``

727

`+

self.assertRaisesRegex(AssertionError, 'not called',

`

728

728

`mock.assert_called_with)

`

729

729

``

730

730

``

`@@ -917,10 +917,11 @@ def assertRaisesWithMsg(self, exception, message, func, *args, **kwargs):

`

917

917

`def test_assert_called_with_failure_message(self):

`

918

918

`mock = NonCallableMock()

`

919

919

``

``

920

`+

actual = 'not called.'

`

920

921

`expected = "mock(1, '2', 3, bar='foo')"

`

921

``

`-

message = 'Expected call: %s\nNot called'

`

``

922

`+

message = 'expected call not found.\nExpected: %s\nActual: %s'

`

922

923

`self.assertRaisesWithMsg(

`

923

``

`-

AssertionError, message % (expected,),

`

``

924

`+

AssertionError, message % (expected, actual),

`

924

925

`mock.assert_called_with, 1, '2', 3, bar='foo'

`

925

926

` )

`

926

927

``

`@@ -933,7 +934,7 @@ def test_assert_called_with_failure_message(self):

`

933

934

`for meth in asserters:

`

934

935

`actual = "foo(1, '2', 3, foo='foo')"

`

935

936

`expected = "foo(1, '2', 3, bar='foo')"

`

936

``

`-

message = 'Expected call: %s\nActual call: %s'

`

``

937

`+

message = 'expected call not found.\nExpected: %s\nActual: %s'

`

937

938

`self.assertRaisesWithMsg(

`

938

939

`AssertionError, message % (expected, actual),

`

939

940

`meth, 1, '2', 3, bar='foo'

`

`@@ -943,7 +944,7 @@ def test_assert_called_with_failure_message(self):

`

943

944

`for meth in asserters:

`

944

945

`actual = "foo(1, '2', 3, foo='foo')"

`

945

946

`expected = "foo(bar='foo')"

`

946

``

`-

message = 'Expected call: %s\nActual call: %s'

`

``

947

`+

message = 'expected call not found.\nExpected: %s\nActual: %s'

`

947

948

`self.assertRaisesWithMsg(

`

948

949

`AssertionError, message % (expected, actual),

`

949

950

`meth, bar='foo'

`

`@@ -953,7 +954,7 @@ def test_assert_called_with_failure_message(self):

`

953

954

`for meth in asserters:

`

954

955

`actual = "foo(1, '2', 3, foo='foo')"

`

955

956

`expected = "foo(1, 2, 3)"

`

956

``

`-

message = 'Expected call: %s\nActual call: %s'

`

``

957

`+

message = 'expected call not found.\nExpected: %s\nActual: %s'

`

957

958

`self.assertRaisesWithMsg(

`

958

959

`AssertionError, message % (expected, actual),

`

959

960

`meth, 1, 2, 3

`

`@@ -963,7 +964,7 @@ def test_assert_called_with_failure_message(self):

`

963

964

`for meth in asserters:

`

964

965

`actual = "foo(1, '2', 3, foo='foo')"

`

965

966

`expected = "foo()"

`

966

``

`-

message = 'Expected call: %s\nActual call: %s'

`

``

967

`+

message = 'expected call not found.\nExpected: %s\nActual: %s'

`

967

968

`self.assertRaisesWithMsg(

`

968

969

`AssertionError, message % (expected, actual), meth

`

969

970

` )

`