[TIP] Is this a bug in unittest.mock, or am I missing something?

John W jwdevel at gmail.com
Thu Feb 16 11:06:17 PST 2017


They seem to be the same types.

I added these prints:

        print("type of call():", type(call()))
        print("type of call().my_method(123):", type(call().my_method(123)))
        for c in MockFoo.mock_calls:
            print("type of mock call '{}': {}".format(c, type(c)))

And output is:

    type of call(): <class 'unittest.mock._Call'>
    type of call().my_method(123): <class 'unittest.mock._Call'>
    type of mock call 'call()': <class 'unittest.mock._Call'>
    type of mock call 'call().my_method(123)': <class 'unittest.mock._Call'>


Thanks for the suggestion though.
I've been getting crickets from every place I've asked this question (:

-John



More information about the testing-in-python mailing list