FYI: If you mock open function by using `builtins....
# general
f
FYI: If you mock open function by using
builtins.open
, don't forget to call self.addCleanup to stop the mock. Otherwise, pants might break
Copy code
INTERNALERROR>   File "/pants/.pants.d/test/pytest-prep/CPython-3.6.8/9af8c28d7aeb4e69b8a4a563c2ce5c843d1408cf/.deps/coverage-4.5.3-cp36-cp36m-manylinux1_x86_64.whl/coverage/parser.py", line 44, in __init__
                     INTERNALERROR>     self.text = get_python_source(self.filename)
                     INTERNALERROR>   File "/pants/.pants.d/test/pytest-prep/CPython-3.6.8/9af8c28d7aeb4e69b8a4a563c2ce5c843d1408cf/.deps/coverage-4.5.3-cp36-cp36m-manylinux1_x86_64.whl/coverage/python.py", line 50, in get_python_source
                     INTERNALERROR>     source = read_python_source(try_filename)
                     INTERNALERROR>   File "/pants/.pants.d/test/pytest-prep/CPython-3.6.8/9af8c28d7aeb4e69b8a4a563c2ce5c843d1408cf/.deps/coverage-4.5.3-cp36-cp36m-manylinux1_x86_64.whl/coverage/python.py", line 34, in read_python_source
                     INTERNALERROR>     return source.replace(b"\r\n", b"\n").replace(b"\r", b"\n")
                     INTERNALERROR> TypeError: replace() argument 1 must be str, not bytes