[Python-checkins] cpython: Make various asyncio test files individually runnable

antoine.pitrou python-checkins at python.org
Sun Oct 20 21:33:04 CEST 2013


http://hg.python.org/cpython/rev/2a2b983c3d4a
changeset:   86516:2a2b983c3d4a
user:        Antoine Pitrou <solipsis at pitrou.net>
date:        Sun Oct 20 21:02:53 2013 +0200
summary:
  Make various asyncio test files individually runnable

files:
  Lib/test/test_asyncio/test_base_events.py     |  4 ++++
  Lib/test/test_asyncio/test_proactor_events.py |  4 ++++
  Lib/test/test_asyncio/test_selector_events.py |  4 ++++
  Lib/test/test_asyncio/test_selectors.py       |  4 ++++
  Lib/test/test_asyncio/test_transports.py      |  4 ++++
  Lib/test/test_asyncio/test_unix_events.py     |  4 ++++
  Lib/test/test_asyncio/test_windows_events.py  |  4 ++++
  Lib/test/test_asyncio/test_windows_utils.py   |  4 ++++
  8 files changed, 32 insertions(+), 0 deletions(-)


diff --git a/Lib/test/test_asyncio/test_base_events.py b/Lib/test/test_asyncio/test_base_events.py
--- a/Lib/test/test_asyncio/test_base_events.py
+++ b/Lib/test/test_asyncio/test_base_events.py
@@ -588,3 +588,7 @@
         self.loop._accept_connection(MyProto, sock)
         self.assertTrue(sock.close.called)
         self.assertTrue(m_log.exception.called)
+
+
+if __name__ == '__main__':
+    unittest.main()
diff --git a/Lib/test/test_asyncio/test_proactor_events.py b/Lib/test/test_asyncio/test_proactor_events.py
--- a/Lib/test/test_asyncio/test_proactor_events.py
+++ b/Lib/test/test_asyncio/test_proactor_events.py
@@ -478,3 +478,7 @@
         self.loop._stop_serving(sock)
         self.assertTrue(sock.close.called)
         self.proactor._stop_serving.assert_called_with(sock)
+
+
+if __name__ == '__main__':
+    unittest.main()
diff --git a/Lib/test/test_asyncio/test_selector_events.py b/Lib/test/test_asyncio/test_selector_events.py
--- a/Lib/test/test_asyncio/test_selector_events.py
+++ b/Lib/test/test_asyncio/test_selector_events.py
@@ -1483,3 +1483,7 @@
         transport._fatal_error(err)
         self.protocol.connection_refused.assert_called_with(err)
         m_exc.assert_called_with('Fatal error for %s', transport)
+
+
+if __name__ == '__main__':
+    unittest.main()
diff --git a/Lib/test/test_asyncio/test_selectors.py b/Lib/test/test_asyncio/test_selectors.py
--- a/Lib/test/test_asyncio/test_selectors.py
+++ b/Lib/test/test_asyncio/test_selectors.py
@@ -143,3 +143,7 @@
     if hasattr(selectors.DefaultSelector, 'fileno'):
         def test_fileno(self):
             self.assertIsInstance(selectors.DefaultSelector().fileno(), int)
+
+
+if __name__ == '__main__':
+    unittest.main()
diff --git a/Lib/test/test_asyncio/test_transports.py b/Lib/test/test_asyncio/test_transports.py
--- a/Lib/test/test_asyncio/test_transports.py
+++ b/Lib/test/test_asyncio/test_transports.py
@@ -53,3 +53,7 @@
         self.assertRaises(NotImplementedError, transport.send_signal, 1)
         self.assertRaises(NotImplementedError, transport.terminate)
         self.assertRaises(NotImplementedError, transport.kill)
+
+
+if __name__ == '__main__':
+    unittest.main()
diff --git a/Lib/test/test_asyncio/test_unix_events.py b/Lib/test/test_asyncio/test_unix_events.py
--- a/Lib/test/test_asyncio/test_unix_events.py
+++ b/Lib/test/test_asyncio/test_unix_events.py
@@ -768,3 +768,7 @@
         tr.write_eof()
         self.assertTrue(tr._closing)
         self.assertFalse(self.protocol.connection_lost.called)
+
+
+if __name__ == '__main__':
+    unittest.main()
diff --git a/Lib/test/test_asyncio/test_windows_events.py b/Lib/test/test_asyncio/test_windows_events.py
--- a/Lib/test/test_asyncio/test_windows_events.py
+++ b/Lib/test/test_asyncio/test_windows_events.py
@@ -93,3 +93,7 @@
                 protocols.Protocol, ADDRESS)
 
         return 'done'
+
+
+if __name__ == '__main__':
+    unittest.main()
diff --git a/Lib/test/test_asyncio/test_windows_utils.py b/Lib/test/test_asyncio/test_windows_utils.py
--- a/Lib/test/test_asyncio/test_windows_utils.py
+++ b/Lib/test/test_asyncio/test_windows_utils.py
@@ -138,3 +138,7 @@
         # allow for partial reads...
         self.assertTrue(msg.upper().rstrip().startswith(out))
         self.assertTrue(b"stderr".startswith(err))
+
+
+if __name__ == '__main__':
+    unittest.main()

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list