How to mock an import. Solution: You can assign to sys.modules['B'] before importing A to get what you want: test.py: import sys sys.modules['B'] ...
確定! 回上一頁