diff --git a/_pytest/assertion/rewrite.py b/_pytest/assertion/rewrite.py index b7a6c1c5e..9484ba4b3 100644 --- a/_pytest/assertion/rewrite.py +++ b/_pytest/assertion/rewrite.py @@ -128,7 +128,7 @@ class AssertionRewritingHook(object): # One of the path components was not a directory, likely # because we're in a zip file. write = False - elif e in [errno.EACCES, errno.EROFS]: + elif e in [errno.EACCES, errno.EROFS, errno.EPERM]: state.trace("read only directory: %r" % fn_pypath.dirname) write = False else: