]> granicus.if.org Git - python/commitdiff
[2.7] bpo-31044: Skip test_posix.test_makedev() on FreeBSD (#2915) (#2918)
authorVictor Stinner <victor.stinner@gmail.com>
Thu, 27 Jul 2017 16:44:43 +0000 (18:44 +0200)
committerGitHub <noreply@github.com>
Thu, 27 Jul 2017 16:44:43 +0000 (18:44 +0200)
* bpo-31044: Skip test_posix.test_makedev() on FreeBSD (#2915)

There is a bug in FreeBSD CURRENT with 64-bit dev_t. Skip the test if
dev_t is larger than 32-bit, until the bug is fixed in FreeBSD
CURRENT.
(cherry picked from commit 12953ffe12ac781332b384c36b25d12216b1db62)

* Fix syntax for Python 2.7

Lib/test/test_posix.py

index f1626b717fca0e32d4fde1e5779558a896352097..bce4e21e992b45696e8e19a8b9ae2376bdce50fd 100644 (file)
@@ -287,6 +287,10 @@ class PosixTester(unittest.TestCase):
         self.assertRaises(TypeError, posix.minor)
         self.assertRaises((ValueError, OverflowError), posix.minor, -1)
 
+        if sys.platform.startswith('freebsd') and dev >= 0x100000000:
+            self.skipTest("bpo-31044: on FreeBSD CURRENT, minor() truncates "
+                          "64-bit dev to 32-bit")
+
         self.assertEqual(posix.makedev(major, minor), dev)
         self.assertEqual(posix.makedev(int(major), int(minor)), dev)
         self.assertEqual(posix.makedev(long(major), long(minor)), dev)