]> granicus.if.org Git - python/commitdiff
Issue #23193: Skip numeric_owner tests on platforms where they don't make sense
authorZachary Ware <zachary.ware@gmail.com>
Wed, 13 May 2015 04:57:21 +0000 (23:57 -0500)
committerZachary Ware <zachary.ware@gmail.com>
Wed, 13 May 2015 04:57:21 +0000 (23:57 -0500)
In particular, the tests bomb out on Windows.  The feature is a no-op on platforms
without the pwd module or os.geteuid anyway.

Lib/test/test_tarfile.py

index 6c20634f9692f3fde438b5bdbaa7b4ccde512e64..45c30aba201bfb350384fa9e31e2e77fb0162245 100644 (file)
@@ -2279,6 +2279,8 @@ def root_is_uid_gid_0():
     return True
 
 
+@unittest.skipUnless(hasattr(os, 'chown'), "missing os.chown")
+@unittest.skipUnless(hasattr(os, 'geteuid'), "missing os.geteuid")
 class NumericOwnerTest(unittest.TestCase):
     # mock the following:
     #  os.chown: so we can test what's being called