python (12.9k questions)
javascript (9.2k questions)
reactjs (4.7k questions)
java (4.2k questions)
java (4.2k questions)
c# (3.5k questions)
c# (3.5k questions)
html (3.3k questions)
Prevent mocked definition from bleeding over to external library in python
Suppose I have some third-party code main.py:
import matplotlib.pyplot as plt
import tkinter
tk = tkinter.Tk()
fig = plt.figure()
ax = plt.gca()
ax.plot([1,2,3])
plt.savefig('test.png')
Suppose tha...
user32882
Votes: 0
Answers: 0
How to mock googleapiclient.discovery.build to unit test reading from google sheets
Hi I want to unit test the below code by mocking the api calls .
def get_data_from_google_sheets(spreadsheet_id, google_creds):
"""
Pupose:
"""
scopes = [...
AMJ
Votes: 0
Answers: 1
Mock only part of the return of a mocked function with jest
Using jest and typescript, I wonder if that's possible to mock only a part of the return of a function. My goal is to pass a spy for the mocked part, and to receive the original function output for th...
neiya
Votes: 0
Answers: 1
Augmenting moto with mock patch where method is not yet implemented
I am writing a lambda function that takes a list of CW Log Groups and runs an "export to s3" task on each of them.
I am writing automated tests using pytest and I'm using moto.mock_logs (amo...
Felipe Alvarez
Votes: 0
Answers: 1