diff options
| author | R. David Murray <rdmurray@bitdance.com> | 2009-03-30 23:05:48 (GMT) |
|---|---|---|
| committer | R. David Murray <rdmurray@bitdance.com> | 2009-03-30 23:05:48 (GMT) |
| commit | 3db8a3432bd84b58bdc7da2c9872777c537a4d09 (patch) | |
| tree | 1a274c25cb002b9cb4474ff0882e2e5a563f9038 /Lib/test/test_ioctl.py | |
| parent | dc340eedaa71bb6a86fd887a807020ccf1cbf520 (diff) | |
| download | cpython-3db8a3432bd84b58bdc7da2c9872777c537a4d09.zip cpython-3db8a3432bd84b58bdc7da2c9872777c537a4d09.tar.gz cpython-3db8a3432bd84b58bdc7da2c9872777c537a4d09.tar.bz2 | |
Change more tests to use import_module for the modules that
should cause tests to be skipped. Also rename import_function
to the more descriptive get_attribute and add a docstring.
Diffstat (limited to 'Lib/test/test_ioctl.py')
| -rw-r--r-- | Lib/test/test_ioctl.py | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/Lib/test/test_ioctl.py b/Lib/test/test_ioctl.py index 4da209d..823d954 100644 --- a/Lib/test/test_ioctl.py +++ b/Lib/test/test_ioctl.py @@ -1,12 +1,9 @@ import unittest -from test.test_support import run_unittest +from test.test_support import run_unittest, import_module, get_attribute import os, struct -try: - import fcntl, termios -except ImportError: - raise unittest.SkipTest("No fcntl or termios module") -if not hasattr(termios,'TIOCGPGRP'): - raise unittest.SkipTest("termios module doesn't have TIOCGPGRP") +fcntl = import_module('fcntl') +termios = import_module('termios') +get_attribute(termios, 'TIOCGPGRP') #Can't run tests without this feature try: tty = open("/dev/tty", "r") |
