StackOverflow Questions for Tag: magicmock

Kai Roesner
Kai Roesner

Reputation: 605

StopIteration when mocking base class of own class

Score: 2

Views: 1414

Answers: 1

Read More
SynackSA
SynackSA

Reputation: 909

Pytest mocker.patch is returning NonCallableMagicMock

Score: 2

Views: 3549

Answers: 1

Read More
Emily
Emily

Reputation: 137

python how to mock 3rd party library response

Score: 1

Views: 1435

Answers: 1

Read More
NAB0815
NAB0815

Reputation: 471

Python unittest returns MagicMock object instead of return value

Score: 4

Views: 628

Answers: 0

Read More
Philip Frerk
Philip Frerk

Reputation: 91

Python Unit Test Mock import & check assert called with

Score: 0

Views: 1244

Answers: 1

Read More
dumbledad
dumbledad

Reputation: 17555

Why is function under test initializing class instead of using the mock in pytest?

Score: 1

Views: 1196

Answers: 2

Read More
Jake Andrews
Jake Andrews

Reputation: 21

Mocking psycopg2 connection to test if data was inserted

Score: 0

Views: 810

Answers: 0

Read More
r_e
r_e

Reputation: 242

How to create magic mock for simple if statement checking if an item exists in a list

Score: 0

Views: 509

Answers: 1

Read More
yonatan gershon
yonatan gershon

Reputation: 105

pytest - mock exception of method to test Flask API

Score: 1

Views: 923

Answers: 1

Read More
Kevin
Kevin

Reputation: 7334

MagicMock not called for signal handler in Python 3

Score: 0

Views: 227

Answers: 1

Read More
TinyTheBrontosaurus
TinyTheBrontosaurus

Reputation: 4840

How to get MagicMock to return multiple values

Score: 2

Views: 6841

Answers: 2

Read More

Mocking cursor.fetchone() returns None istead of returning a value in python

Score: 0

Views: 1050

Answers: 1

Read More
alvas
alvas

Reputation: 122330

How to check of exceptions in nested functions when using MagicMock objects in Pytest?

Score: 2

Views: 1223

Answers: 1

Read More
Roberto
Roberto

Reputation: 1097

How to apply a decorator to a MagicMock function in unittest?

Score: 1

Views: 21

Answers: 0

Read More
studioj
studioj

Reputation: 1400

is there a simple way of adding __name__ to MagicMock attributes recursively

Score: 5

Views: 978

Answers: 1

Read More
user1522160
user1522160

Reputation: 59

python mocks a function properly, however the call count is not accounted

Score: 0

Views: 1715

Answers: 1

Read More
alegria
alegria

Reputation: 1482

AttributeError: _mock_methods when extending MagicMock class

Score: 7

Views: 1877

Answers: 1

Read More
Michael Z
Michael Z

Reputation: 4013

Mocking dependencies

Score: 0

Views: 38

Answers: 1

Read More
algorhythm
algorhythm

Reputation: 3446

How can I verify a Python method was called with parameters including a DataFrames?

Score: 0

Views: 1217

Answers: 1

Read More
AnaF
AnaF

Reputation: 353

Mock entire python class

Score: 33

Views: 49846

Answers: 2

Read More
PreviousPage 4Next