Python test.test_support.DirsOnSysPath() Examples

The following are 22 code examples of test.test_support.DirsOnSysPath(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module test.test_support , or try the search function .
Example #1
Source File: test_tk.py    From gcblue with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def test_main():
    with test_support.DirsOnSysPath(lib_tk_test):
        test_support.run_unittest(
            *runtktests.get_tests(text=False, packages=['test_tkinter'])) 
Example #2
Source File: test_ttk_textonly.py    From CTFCrackTools with GNU General Public License v3.0 5 votes vote down vote up
def test_main():
    with test_support.DirsOnSysPath(lib_tk_test):
        test_support.run_unittest(
            *runtktests.get_tests(gui=False, packages=['test_ttk'])) 
Example #3
Source File: test_classpathimporter.py    From CTFCrackTools with GNU General Public License v3.0 5 votes vote down vote up
def test_path_in_pyclasspath(self):
        jar = self.prepareJar('classimport_Lib.jar')
        compiled = self.compileToJar(jar, 'Lib')
        Thread.currentThread().contextClassLoader = test_support.make_jar_classloader(jar)
        with test_support.DirsOnSysPath():
            sys.path = ['__pyclasspath__/Lib']
            self.checkImports('__pyclasspath__/Lib', compiled) 
Example #4
Source File: test_classpathimporter.py    From CTFCrackTools with GNU General Public License v3.0 5 votes vote down vote up
def test_bug1126(self):
        jar = test_support.findfile("bug1126.jar", subdir="bug1126")
        with test_support.DirsOnSysPath(jar):
            import org.subpackage 
Example #5
Source File: test_classpathimporter.py    From CTFCrackTools with GNU General Public License v3.0 5 votes vote down vote up
def test_bug1239(self):
        jar = test_support.findfile("bug1239.jar")
        with test_support.DirsOnSysPath(jar):
            import org.test403javapackage.test403

    # different from test_bug1239 in that only a Java package is imported, not
    # a Java class.  I'd also like to get rid of this checked in test jar. 
Example #6
Source File: test_ttk_guionly.py    From CTFCrackTools with GNU General Public License v3.0 5 votes vote down vote up
def test_main(enable_gui=False):
    if enable_gui:
        if test_support.use_resources is None:
            test_support.use_resources = ['gui']
        elif 'gui' not in test_support.use_resources:
            test_support.use_resources.append('gui')

    with test_support.DirsOnSysPath(lib_tk_test):
        from test_ttk.support import get_tk_root
        try:
            test_support.run_unittest(
                *runtktests.get_tests(text=False, packages=['test_ttk']))
        finally:
            get_tk_root().destroy() 
Example #7
Source File: test_ttk_textonly.py    From CTFCrackTools-V2 with GNU General Public License v3.0 5 votes vote down vote up
def test_main():
    with test_support.DirsOnSysPath(lib_tk_test):
        test_support.run_unittest(
            *runtktests.get_tests(gui=False, packages=['test_ttk'])) 
Example #8
Source File: test_classpathimporter.py    From CTFCrackTools-V2 with GNU General Public License v3.0 5 votes vote down vote up
def test_path_in_pyclasspath(self):
        jar = self.prepareJar('classimport_Lib.jar')
        compiled = self.compileToJar(jar, 'Lib')
        Thread.currentThread().contextClassLoader = test_support.make_jar_classloader(jar)
        with test_support.DirsOnSysPath():
            sys.path = ['__pyclasspath__/Lib']
            self.checkImports('__pyclasspath__/Lib', compiled) 
Example #9
Source File: test_classpathimporter.py    From CTFCrackTools-V2 with GNU General Public License v3.0 5 votes vote down vote up
def test_bug1126(self):
        jar = test_support.findfile("bug1126.jar", subdir="bug1126")
        with test_support.DirsOnSysPath(jar):
            import org.subpackage 
Example #10
Source File: test_classpathimporter.py    From CTFCrackTools-V2 with GNU General Public License v3.0 5 votes vote down vote up
def test_bug1239(self):
        jar = test_support.findfile("bug1239.jar")
        with test_support.DirsOnSysPath(jar):
            import org.test403javapackage.test403

    # different from test_bug1239 in that only a Java package is imported, not
    # a Java class.  I'd also like to get rid of this checked in test jar. 
Example #11
Source File: test_ttk_guionly.py    From CTFCrackTools-V2 with GNU General Public License v3.0 5 votes vote down vote up
def test_main(enable_gui=False):
    if enable_gui:
        if test_support.use_resources is None:
            test_support.use_resources = ['gui']
        elif 'gui' not in test_support.use_resources:
            test_support.use_resources.append('gui')

    with test_support.DirsOnSysPath(lib_tk_test):
        from test_ttk.support import get_tk_root
        try:
            test_support.run_unittest(
                *runtktests.get_tests(text=False, packages=['test_ttk']))
        finally:
            get_tk_root().destroy() 
Example #12
Source File: test_ttk_guionly.py    From ironpython2 with Apache License 2.0 5 votes vote down vote up
def test_main():
    with test_support.DirsOnSysPath(lib_tk_test):
        test_support.run_unittest(
            *runtktests.get_tests(text=False, packages=['test_ttk'])) 
Example #13
Source File: test_ttk_textonly.py    From gcblue with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def test_main():
    with test_support.DirsOnSysPath(lib_tk_test):
        test_support.run_unittest(
            *runtktests.get_tests(gui=False, packages=['test_ttk'])) 
Example #14
Source File: test_ttk_guionly.py    From gcblue with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def test_main():
    with test_support.DirsOnSysPath(lib_tk_test):
        from test_ttk.support import get_tk_root
        try:
            test_support.run_unittest(
                *runtktests.get_tests(text=False, packages=['test_ttk']))
        finally:
            get_tk_root().destroy() 
Example #15
Source File: test_tk.py    From oss-ftp with MIT License 5 votes vote down vote up
def test_main():
    with test_support.DirsOnSysPath(lib_tk_test):
        test_support.run_unittest(
            *runtktests.get_tests(text=False, packages=['test_tkinter'])) 
Example #16
Source File: test_ttk_textonly.py    From oss-ftp with MIT License 5 votes vote down vote up
def test_main():
    with test_support.DirsOnSysPath(lib_tk_test):
        test_support.run_unittest(
            *runtktests.get_tests(gui=False, packages=['test_ttk'])) 
Example #17
Source File: test_ttk_guionly.py    From oss-ftp with MIT License 5 votes vote down vote up
def test_main():
    with test_support.DirsOnSysPath(lib_tk_test):
        test_support.run_unittest(
            *runtktests.get_tests(text=False, packages=['test_ttk'])) 
Example #18
Source File: test_tk.py    From BinderFilter with MIT License 5 votes vote down vote up
def test_main(enable_gui=False):
    if enable_gui:
        if test_support.use_resources is None:
            test_support.use_resources = ['gui']
        elif 'gui' not in test_support.use_resources:
            test_support.use_resources.append('gui')

    with test_support.DirsOnSysPath(lib_tk_test):
        test_support.run_unittest(
            *runtktests.get_tests(text=False, packages=['test_tkinter'])) 
Example #19
Source File: test_ttk_textonly.py    From BinderFilter with MIT License 5 votes vote down vote up
def test_main():
    with test_support.DirsOnSysPath(lib_tk_test):
        test_support.run_unittest(
            *runtktests.get_tests(gui=False, packages=['test_ttk'])) 
Example #20
Source File: test_ttk_guionly.py    From BinderFilter with MIT License 5 votes vote down vote up
def test_main(enable_gui=False):
    if enable_gui:
        if test_support.use_resources is None:
            test_support.use_resources = ['gui']
        elif 'gui' not in test_support.use_resources:
            test_support.use_resources.append('gui')

    with test_support.DirsOnSysPath(lib_tk_test):
        from test_ttk.support import get_tk_root
        try:
            test_support.run_unittest(
                *runtktests.get_tests(text=False, packages=['test_ttk']))
        finally:
            get_tk_root().destroy() 
Example #21
Source File: test_tk.py    From ironpython2 with Apache License 2.0 5 votes vote down vote up
def test_main():
    with test_support.DirsOnSysPath(lib_tk_test):
        test_support.run_unittest(
            *runtktests.get_tests(text=False, packages=['test_tkinter'])) 
Example #22
Source File: test_ttk_textonly.py    From ironpython2 with Apache License 2.0 5 votes vote down vote up
def test_main():
    with test_support.DirsOnSysPath(lib_tk_test):
        test_support.run_unittest(
            *runtktests.get_tests(gui=False, packages=['test_ttk']))