- script to run all the tests
- don't print warning if test module is not main module
diff --git a/pyserial/examples/test_iolib.py b/pyserial/examples/test_iolib.py
index 5bcaed3..d4e9315 100644
--- a/pyserial/examples/test_iolib.py
+++ b/pyserial/examples/test_iolib.py
@@ -29,7 +29,7 @@
import unittest
import sys
-if sys.version_info < (2, 6):
+if __name__ == '__main__' and sys.version_info < (2, 6):
sys.stderr.write("""\
==============================================================================
WARNING: this test is intended for Python 2.6 and newer where the io library