Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Paste
P990
pytest wat
Active
Public
Actions
Authored by
vlorentz
on Mar 25 2021, 5:45 PM.
Edit Paste
Archive Paste
View Raw File
Subscribe
Mute Notifications
Award Token
Flag For Later
Tags
None
Subscribers
None
def
test_foo
():
from
unittest.mock
import
MagicMock
,
call
f
=
MagicMock
()
f
(
"foo"
,
[
b
"bar"
])
f
(
"foo"
,
[
b
"baz"
])
f
.
assert_has_calls
(
[
call
(
"foo"
,
[
"bar"
]),
call
(
"foo"
,
[
"baz"
]),
],
>
any_order
=
True
)
E
AssertionError
:
(
call
(
'foo'
,
[
'bar'
]),
call
(
'foo'
,
[
'baz'
]))
not
all
found
in
call
list
E
E
pytest
introspection
follows
:
E
E
Args
:
E
assert
(
'foo'
,
[
b
'baz'
])
==
([
call
(
'foo'
,
[
'bar'
]),
call
(
'foo'
,
[
'baz'
])],)
E
At
index
0
diff
:
'foo'
!=
[
call
(
'foo'
,
[
'bar'
]),
call
(
'foo'
,
[
'baz'
])]
E
Left
contains
one
more
item
:
[
b
'baz'
]
E
Full
diff
:
E
-
([
call
(
'foo'
,
[
'bar'
]),
call
(
'foo'
,
[
'baz'
])],)
E
+
(
'foo'
,
[
b
'baz'
])
E
Kwargs
:
E
assert
{}
==
{
'any_order'
:
True
}
E
Right
contains
1
more
item
:
E
{
'any_order'
:
True
}
E
Full
diff
:
E
-
{
'any_order'
:
True
}
E
+
{}
Event Timeline
vlorentz
created this paste.
Mar 25 2021, 5:45 PM
2021-03-25 17:45:16 (UTC+1)
Log In to Comment