Commit d7d4fea4 authored by xdegaye's avatar xdegaye Committed by GitHub

bpo-29181: Skip test_tarfile tests on PermissionError raised by Android (GH-4375)

parent 6a55d095
...@@ -1147,7 +1147,10 @@ class WriteTest(WriteTestBase, unittest.TestCase): ...@@ -1147,7 +1147,10 @@ class WriteTest(WriteTestBase, unittest.TestCase):
target = os.path.join(TEMPDIR, "link_target") target = os.path.join(TEMPDIR, "link_target")
with open(target, "wb") as fobj: with open(target, "wb") as fobj:
fobj.write(b"aaa") fobj.write(b"aaa")
try:
os.link(target, link) os.link(target, link)
except PermissionError as e:
self.skipTest('os.link(): %s' % e)
try: try:
tar = tarfile.open(tmpname, self.mode) tar = tarfile.open(tmpname, self.mode)
try: try:
...@@ -1609,7 +1612,10 @@ class HardlinkTest(unittest.TestCase): ...@@ -1609,7 +1612,10 @@ class HardlinkTest(unittest.TestCase):
with open(self.foo, "wb") as fobj: with open(self.foo, "wb") as fobj:
fobj.write(b"foo") fobj.write(b"foo")
try:
os.link(self.foo, self.bar) os.link(self.foo, self.bar)
except PermissionError as e:
self.skipTest('os.link(): %s' % e)
self.tar = tarfile.open(tmpname, "w") self.tar = tarfile.open(tmpname, "w")
self.tar.add(self.foo) self.tar.add(self.foo)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment