Home
last modified time | relevance | path

Searched refs:swap_attr (Results 1 – 25 of 52) sorted by relevance

123

/external/python/cpython3/Lib/distutils/tests/
Dtest_log.py6 from test.support import swap_attr, run_unittest
24 with swap_attr(sys, 'stdout', stdout), \
25 swap_attr(sys, 'stderr', stderr):
/external/python/cpython3/Lib/test/
Dtest_dynamic.py6 from test.support import swap_item, swap_attr
45 with swap_attr(builtins, "len", lambda x: 7):
58 with swap_attr(builtins, "len", lambda x: 7):
64 with swap_attr(builtins, "len", len):
Dtest_support.py59 with support.swap_attr(support, 'verbose', 0):
65 with support.swap_attr(support, 'verbose', 0):
72 with support.swap_attr(support, 'verbose', 0):
329 with support.swap_attr(obj, "x", 5) as x:
333 with support.swap_attr(obj, "y", 5) as y:
337 with support.swap_attr(obj, "y", 5):
531 with support.swap_attr(support, '_match_test_func', None):
578 with support.swap_attr(support, '_match_test_func', None):
Dtest_linecache.py230 with support.swap_attr(linecache, 'updatecache', raise_memoryerror):
235 with support.swap_attr(linecache, 'updatecache', raise_memoryerror):
Dtest_tempfile.py263 with support.swap_attr(tempfile, "_candidate_tempdir_list",
272 with support.swap_attr(io, "open", raise_OSError):
283 with support.swap_attr(io, "open", bad_writer) as orig_open:
310 with support.swap_attr(tempfile, 'tempdir', dir):
317 return support.swap_attr(tempfile,
341 with support.swap_attr(tempfile, 'tempdir', tempdir):
349 with support.swap_attr(tempfile, 'tempdir', tempdir):
Dtest_netrc.py161 with support.swap_attr(os.path, 'expanduser', fake_expanduser):
Dtest_sys.py66 with support.swap_attr(sys, 'displayhook', baddisplayhook):
956 with test.support.swap_attr(sys, 'unraisablehook',
990 test.support.swap_attr(sys, 'unraisablehook',
1011 with test.support.swap_attr(sys, 'unraisablehook',
1025 with test.support.swap_attr(sys, 'unraisablehook', hook_func):
1042 with test.support.swap_attr(sys, 'unraisablehook', hook_func):
Dtest_strptime.py400 with support.swap_attr(time, 'tzname', (tz_name, tz_name)), \
401 support.swap_attr(time, 'daylight', 1), \
402 support.swap_attr(time, 'tzset', lambda: None):
Dtest_threading.py1299 with support.swap_attr(threading, 'excepthook', hook):
1322 with support.swap_attr(threading, 'excepthook', threading_hook), \
1323 support.swap_attr(sys, 'excepthook', sys_hook), \
Dtest_shutil.py1775 support.swap_attr(os, 'defpath', self.dir), \
1793 support.swap_attr(os, 'defpath', self.dir):
1809 support.swap_attr(os, 'defpath', self.dir):
1816 support.swap_attr(os, 'defpath', ''):
2112 with support.swap_attr(shutil, 'open', _open):
2127 with support.swap_attr(shutil, 'open', _open):
2146 with support.swap_attr(shutil, 'open', _open):
2168 with support.swap_attr(shutil, 'open', _open):
2543 with support.swap_attr(sys, '__stdout__', None):
2551 support.swap_attr(sys, '__stdout__', f):
Dtest_fileio.py13 make_bad_fd, cpython_only, swap_attr)
181 with swap_attr(self.f, 'name', self.f):
Dtest_traceback.py775 with support.swap_attr(sys, 'tracebacklimit', 1000):
802 with support.swap_attr(sys, 'tracebacklimit', 1000):
831 with support.swap_attr(sys, 'tracebacklimit', 1000):
Dtest_mimetypes.py78 … with support.swap_attr(_bootlocale, 'getpreferredencoding', lambda do_setlocale=True: 'ASCII'):
/external/python/cpython2/Lib/test/
Dtest_test_support.py72 with support.swap_attr(support, 'verbose', 0):
78 with support.swap_attr(support, 'verbose', 0):
85 with support.swap_attr(support, 'verbose', 0):
337 with support.swap_attr(obj, "x", 5) as x:
341 with support.swap_attr(obj, "y", 5) as y:
345 with support.swap_attr(obj, "y", 5):
374 with support.swap_attr(support, '_match_test_func', None):
Dtest_linecache.py132 with support.swap_attr(linecache, 'updatecache', raise_memoryerror):
137 with support.swap_attr(linecache, 'updatecache', raise_memoryerror):
Dtest_tempfile.py229 with support.swap_attr(tempfile, "_candidate_tempdir_list",
238 with support.swap_attr(io, "open", raise_OSError):
250 with support.swap_attr(io, "open", bad_writer) as orig_open:
284 with support.swap_attr(tempfile, 'tempdir', dir):
291 return support.swap_attr(tempfile,
316 with support.swap_attr(tempfile, 'tempdir', tempdir):
325 with support.swap_attr(tempfile, 'tempdir', tempdir):
Dtest_tools.py438 with test_support.swap_attr(sys, "argv", argv), \
439 test_support.swap_attr(sys, "stdin", StringIO(input)), \
Dtest_strptime.py319 with support.swap_attr(time, 'tzname', (tz_name, tz_name)), \
320 support.swap_attr(time, 'daylight', 1), \
321 support.swap_attr(time, 'tzset', lambda: None):
Dtest_poplib.py220 with test_support.swap_attr(self.client, 'welcome', evil_welcome):
/external/python/cpython3/Lib/test/test_tools/
Dtest_fixcid.py84 with support.swap_attr(sys, "argv", argv), \
85 support.swap_attr(sys, "stdin", StringIO(input)), \
/external/python/cpython3/Lib/tkinter/test/test_ttk/
Dtest_extensions.py5 from test.support import requires, run_unittest, swap_attr
52 with swap_attr(tkinter, '_default_root', None), \
53 swap_attr(tkinter, '_support_default_root', True):
/external/python/cpython2/Lib/lib-tk/test/test_ttk/
Dtest_extensions.py5 from test.test_support import requires, run_unittest, swap_attr
52 with swap_attr(tkinter, '_default_root', None), \
53 swap_attr(tkinter, '_support_default_root', True):
/external/python/cpython2/Lib/distutils/tests/
Dtest_spawn.py94 with test_support.swap_attr(spawn.os, 'defpath', tmp_dir):
/external/python/cpython3/Lib/test/test_warnings/
D__init__.py829 with support.swap_attr(wmod, 'onceregistry', None):
844 with support.swap_attr(wmod, 'defaultaction', None), \
917 with support.swap_attr(self.module, 'formatwarning', myformatwarning):
1058 with support.swap_attr(wmod, 'showwarning', my_logger):
/external/python/cpython3/Lib/test/test_import/
D__init__.py24 make_legacy_pyc, rmtree, swap_attr, swap_item, temp_umask,
431 with swap_attr(os, '__name__', None):
823 with swap_attr(builtins, "__import__", lambda *x: 5):

123