Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(113406)

Side by Side Diff: Lib/test/test_gc.py

Issue 23670: Modifications to support iOS as a development platform
Patch Set: Created 3 years, 8 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Lib/test/test_file_eintr.py ('k') | Lib/test/test_gdb.py » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 import unittest 1 import unittest
2 from test.support import (verbose, refcount_test, run_unittest, 2 from test.support import (verbose, refcount_test, run_unittest,
3 strip_python_stderr, cpython_only, start_threads, 3 strip_python_stderr, cpython_only, start_threads,
4 temp_dir) 4 temp_dir)
5 from test.support.script_helper import assert_python_ok, make_script 5 from test.support.script_helper import assert_python_ok, make_script
6 6
7 import sys 7 import sys
8 import time 8 import time
9 import gc 9 import gc
10 import weakref 10 import weakref
(...skipping 632 matching lines...) Expand 10 before | Expand all | Expand 10 after
643 return "<X %%r>" %% self.name 643 return "<X %%r>" %% self.name
644 def __tp_del__(self): 644 def __tp_del__(self):
645 pass 645 pass
646 646
647 x = X('first') 647 x = X('first')
648 x.x = x 648 x.x = x
649 x.y = X('second') 649 x.y = X('second')
650 del x 650 del x
651 gc.set_debug(%s) 651 gc.set_debug(%s)
652 """ 652 """
653
654 @unittest.skipUnless(hasattr(subprocess, 'Popen'), "test requires subpro cess.Popen()")
653 def run_command(code): 655 def run_command(code):
654 p = subprocess.Popen([sys.executable, "-Wd", "-c", code], 656 p = subprocess.Popen([sys.executable, "-Wd", "-c", code],
655 stdout=subprocess.PIPE, 657 stdout=subprocess.PIPE,
656 stderr=subprocess.PIPE) 658 stderr=subprocess.PIPE)
657 stdout, stderr = p.communicate() 659 stdout, stderr = p.communicate()
658 p.stdout.close() 660 p.stdout.close()
659 p.stderr.close() 661 p.stderr.close()
660 self.assertEqual(p.returncode, 0) 662 self.assertEqual(p.returncode, 0)
661 self.assertEqual(stdout.strip(), b"") 663 self.assertEqual(stdout.strip(), b"")
662 return strip_python_stderr(stderr) 664 return strip_python_stderr(stderr)
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after
1019 if verbose: 1021 if verbose:
1020 print("restoring automatic collection") 1022 print("restoring automatic collection")
1021 # make sure to always test gc.enable() 1023 # make sure to always test gc.enable()
1022 gc.enable() 1024 gc.enable()
1023 assert gc.isenabled() 1025 assert gc.isenabled()
1024 if not enabled: 1026 if not enabled:
1025 gc.disable() 1027 gc.disable()
1026 1028
1027 if __name__ == "__main__": 1029 if __name__ == "__main__":
1028 test_main() 1030 test_main()
OLDNEW
« no previous file with comments | « Lib/test/test_file_eintr.py ('k') | Lib/test/test_gdb.py » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+