summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_ttk_textonly.py
diff options
context:
space:
mode:
authorNick Coghlan <ncoghlan@gmail.com>2009-10-17 14:40:54 (GMT)
committerNick Coghlan <ncoghlan@gmail.com>2009-10-17 14:40:54 (GMT)
commit7df72dcdf9219db2f10889809d75f9bd8a99c14f (patch)
treed2730ef7c0e75377742fee6bc2875e3e657a8f3c /Lib/test/test_ttk_textonly.py
parente363b1434d6d659bdb94ab522a9da78f1f5a8bef (diff)
downloadcpython-7df72dcdf9219db2f10889809d75f9bd8a99c14f.zip
cpython-7df72dcdf9219db2f10889809d75f9bd8a99c14f.tar.gz
cpython-7df72dcdf9219db2f10889809d75f9bd8a99c14f.tar.bz2
Restore original sys.path when running TTK tests
Diffstat (limited to 'Lib/test/test_ttk_textonly.py')
-rw-r--r--Lib/test/test_ttk_textonly.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/test/test_ttk_textonly.py b/Lib/test/test_ttk_textonly.py
index dde1b35..e0cb2f5 100644
--- a/Lib/test/test_ttk_textonly.py
+++ b/Lib/test/test_ttk_textonly.py
@@ -7,13 +7,13 @@ test_support.import_module('_tkinter')
this_dir = os.path.dirname(os.path.abspath(__file__))
lib_tk_test = os.path.abspath(os.path.join(this_dir, '..', 'lib-tk', 'test'))
-if lib_tk_test not in sys.path:
- sys.path.append(lib_tk_test)
-import runtktests
+with test_support.DirsOnSysPath(lib_tk_test):
+ import runtktests
def test_main():
- test_support.run_unittest(
+ with test_support.DirsOnSysPath(lib_tk_test):
+ test_support.run_unittest(
*runtktests.get_tests(gui=False, packages=['test_ttk']))
if __name__ == '__main__':