diff options
-rw-r--r-- | Doc/library/select.rst | 8 | ||||
-rw-r--r-- | Doc/library/socket.rst | 14 | ||||
-rw-r--r-- | Lib/test/test_fileio.py | 10 | ||||
-rw-r--r-- | Lib/test/test_io.py | 1 |
4 files changed, 23 insertions, 10 deletions
diff --git a/Doc/library/select.rst b/Doc/library/select.rst index 8b466cf..48e289a 100644 --- a/Doc/library/select.rst +++ b/Doc/library/select.rst @@ -355,7 +355,7 @@ http://www.freebsd.org/cgi/man.cgi?query=kqueue&sektion=2 Filter specific flags - *:const:`KQ_FILTER_READ` and :const:`KQ_FILTER_WRITE` filter flags* + :const:`KQ_FILTER_READ` and :const:`KQ_FILTER_WRITE` filter flags +----------------------------+--------------------------------------------+ | Constant | Meaning | @@ -364,7 +364,7 @@ http://www.freebsd.org/cgi/man.cgi?query=kqueue&sektion=2 +----------------------------+--------------------------------------------+ - *:const:`KQ_FILTER_VNODE` filter flags* + :const:`KQ_FILTER_VNODE` filter flags +----------------------------+--------------------------------------------+ | Constant | Meaning | @@ -385,7 +385,7 @@ http://www.freebsd.org/cgi/man.cgi?query=kqueue&sektion=2 +----------------------------+--------------------------------------------+ - *:const:`KQ_FILTER_PROC` filter flags* + :const:`KQ_FILTER_PROC` filter flags +----------------------------+--------------------------------------------+ | Constant | Meaning | @@ -408,7 +408,7 @@ http://www.freebsd.org/cgi/man.cgi?query=kqueue&sektion=2 | :const:`KQ_NOTE_TRACKERR` | unable to attach to a child | +----------------------------+--------------------------------------------+ - *:const:`KQ_FILTER_NETDEV` filter flags* [not available on Mac OS X] + :const:`KQ_FILTER_NETDEV` filter flags [not available on Mac OS X] +----------------------------+--------------------------------------------+ | Constant | Meaning | diff --git a/Doc/library/socket.rst b/Doc/library/socket.rst index 620d08e..536b3c5 100644 --- a/Doc/library/socket.rst +++ b/Doc/library/socket.rst @@ -260,11 +260,15 @@ The module :mod:`socket` exports the following constants and functions: .. function:: gethostname() Return a string containing the hostname of the machine where the Python - interpreter is currently executing. If you want to know the current machine's IP - address, you may want to use ``gethostbyname(gethostname())``. This operation - assumes that there is a valid address-to-host mapping for the host, and the - assumption does not always hold. Note: :func:`gethostname` doesn't always return - the fully qualified domain name; use ``getfqdn()`` (see above). + interpreter is currently executing. + + If you want to know the current machine's IP address, you may want to use + ``gethostbyname(gethostname())``. This operation assumes that there is a + valid address-to-host mapping for the host, and the assumption does not + always hold. + + Note: :func:`gethostname` doesn't always return the fully qualified domain + name; use ``getfqdn()`` (see above). .. function:: gethostbyaddr(ip_address) diff --git a/Lib/test/test_fileio.py b/Lib/test/test_fileio.py index 0404a19..a11d3ba 100644 --- a/Lib/test/test_fileio.py +++ b/Lib/test/test_fileio.py @@ -6,7 +6,7 @@ import unittest from array import array from weakref import proxy -from test.support import TESTFN, findfile, run_unittest +from test.support import TESTFN, findfile, check_warnings, run_unittest from collections import UserList import _fileio @@ -240,6 +240,14 @@ class OtherFileTests(unittest.TestCase): def testInvalidInit(self): self.assertRaises(TypeError, _fileio._FileIO, "1", 0, 0) + def testWarnings(self): + with check_warnings() as w: + self.assertEqual(w.warnings, []) + self.assertRaises(TypeError, _fileio._FileIO, []) + self.assertEqual(w.warnings, []) + self.assertRaises(ValueError, _fileio._FileIO, "/some/invalid/name", "rt") + self.assertEqual(w.warnings, []) + def test_main(): # Historically, these tests have been sloppy about removing TESTFN. diff --git a/Lib/test/test_io.py b/Lib/test/test_io.py index 1f0295c..83d363d 100644 --- a/Lib/test/test_io.py +++ b/Lib/test/test_io.py @@ -1260,6 +1260,7 @@ class MiscIOTest(unittest.TestCase): else: self.assert_(issubclass(obj, io.IOBase)) + def test_main(): support.run_unittest(IOTest, BytesIOTest, StringIOTest, BufferedReaderTest, BufferedWriterTest, |