use skipTest()
diff --git a/Lib/test/test_os.py b/Lib/test/test_os.py
index 9b8ba02..42716fe 100644
--- a/Lib/test/test_os.py
+++ b/Lib/test/test_os.py
@@ -37,10 +37,7 @@
                 retries += 1
                 if retries > 10:
                     # XXX test skipped
-                    print >> sys.stderr, (
-                        "couldn't allocate two consecutive fds, "
-                        "skipping test_closerange")
-                    return
+                    self.skipTest("couldn't allocate two consecutive fds")
                 first, second = second, os.dup(second)
         finally:
             os.close(second)