Re: Having trouble with Mock and exception side effects

2020-08-21 Thread Kushal Kumaran
You could attempt something like what is mentioned in https://docs.python.org/3/library/unittest.mock-examples.html#partial-mocking See below. "Joshua J. Kugler" writes: > Hello! I am using Mock to raise an exception in an function as a side > effect. > However, Mock is completely redefining

Having trouble with Mock and exception side effects

2020-08-21 Thread Joshua J. Kugler
Hello! I am using Mock to raise an exception in an function as a side effect. However, Mock is completely redefining the exception itself turning it in to a MagickMock object, which generates the Python exception TypeError: catching classes that do not inherit from BaseException is not allowed