Skip to content
Advertisement

Tag: python-3.x

When using the method while, it throws an error Name error [closed]

Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers. This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers. Closed 1 year ago. Improve this question

How to mock subsequent function calls in python?

I’m new to testing and testing in python. I have a python class that looks like this : File name : my_hive.py I want to mock these functions : pyhive.hive.connect, pyhive.Connection.cursor(used by my class as hive.connect(hive_ip).cursor()) and pyhive.Cursor.execute (used by my class as self.cursor.execute(command) in execute method). I’m able to mock function call hive.connect and also I have been able

How to stop Recursion and return answer?

This is a sudoku solver function and I have 2 questions: Why 2nd print print the original sudoku? How can I get the sudoku solution (not print it), because I want to reuse the solution. (I have tried using return sudoku but get None) Thanks:) Answer Maybe it is not elegant but I use global list all_solutions and append duplicated

Advertisement