A small correction...
On Mon, 13 Mar 2017 at 22:36 Matt Wheeler wrote:
> ```
> from unittest.mock import patch
>
> import lorem
>
>
> @patch('lorem.type')
> def test_things(mocktype):
> lorem.quux(metameta.Foo())
>
> lorem.return_value.assert_called_with()
>
this line should of course re
On Mon, 13 Mar 2017 at 00:52 Ben Finney wrote:
> How can I override the metaclass of a Python class, with a
> `unittest.mock.MagicMock` instance instead?
>
At first I misunderstood what you were looking for, and was about to reply
to the effect of "you're too late, the metaclass has already been
How can I override the metaclass of a Python class, with a
`unittest.mock.MagicMock` instance instead?
I have a function whose job involves working with the metaclass of an
argument::
# lorem.py
class Foo(object):
pass
def quux(existing_class):
…
metaclass =