1

Ignoring the classic of going through all the directories and files in my project and searching for any rogue print function , Is there a way of tracing a location of print function that printed output to console, or overriding the print function to raise error, or also print its file name and directory, I've tried googling it and using the trace module , but had no success - I'll appreciate any help ,Thx.

DanielGzgzz
  • 118
  • 1
  • 6
  • You can mock the print function via the `unittest.mock` module, see https://stackoverflow.com/questions/12998908/mock-pythons-built-in-print-function for example – Tim Mar 03 '22 at 22:56

0 Answers0