Re: Trouble with mocking

2024-09-20 Thread Mark Bourne via Python-list
Norman Robins wrote: I'm somewhat new to mocking for unit tests. I have some code like this: In foo/bar/baz.py I have 2 function I want to mock, one calls the other" def function1_to_mock(): . . . def function2_to_mock(): function1_to_mock() In foo/bar/main.py I import 1 of th

Trouble with mocking

2024-09-03 Thread Norman Robins via Python-list
I'm somewhat new to mocking for unit tests. I have some code like this: In foo/bar/baz.py I have 2 function I want to mock, one calls the other" def function1_to_mock(): . . . def function2_to_mock(): function1_to_mock() In foo/bar/main.py I import 1 of these and call it" from .baz