remove "mock-1.0.0" vendored library
Categories
(Firefox Build System :: Mach Core, task)
Tracking
(firefox91 fixed)
Tracking | Status | |
---|---|---|
firefox91 | --- | fixed |
People
(Reporter: mhentges, Assigned: mhentges)
References
(Blocks 1 open bug)
Details
Attachments
(4 files)
We have unittest.mock
in Python 3, let's use that instead.
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Updated•4 years ago
|
Assignee | ||
Comment 1•4 years ago
|
||
Python 3 has access to unittest.mock
in the standard library.
Depends on D117072
Assignee | ||
Comment 2•4 years ago
|
||
The calls
parameter is expected to be an iterable
container of calls, not a singular call.
This was working in mock-1.0.0
because calls
was (confusingly) allowed to be a single item
if any_order==False
. This behaviour isn't
the same in th standard library.
Depends on D117073
Assignee | ||
Comment 3•4 years ago
|
||
Depends on D117074
Assignee | ||
Comment 4•4 years ago
|
||
In the vendored mock
library, assert_called()
returns the
MagicMock
instance again - I'm not sure that it does the actual
assertion, so assert instance.is_called()
may be a no-op.
Fortunately, in unittest.mock
, assert_called()
does the assertion
internally, and returns None
. Since assert None
causes a failure,
we need to tweak the invalid usage accordingly.
Depends on D117074
Comment 7•4 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/f7970286ea6a
https://hg.mozilla.org/mozilla-central/rev/cf4fe27bad4e
https://hg.mozilla.org/mozilla-central/rev/fd0fdbf27acd
https://hg.mozilla.org/mozilla-central/rev/0dad88dc18d6
https://hg.mozilla.org/mozilla-central/rev/f446b540fbe9
Description
•