mirror of
https://github.com/python/cpython.git
synced 2025-12-02 15:48:58 +00:00
Make test_runpy re-entrant.
This commit is contained in:
parent
879975677a
commit
dbed7a7394
2 changed files with 6 additions and 1 deletions
|
|
@ -4,7 +4,7 @@ import os
|
||||||
import os.path
|
import os.path
|
||||||
import sys
|
import sys
|
||||||
import tempfile
|
import tempfile
|
||||||
from test.test_support import verbose, run_unittest
|
from test.test_support import verbose, run_unittest, forget
|
||||||
from runpy import _run_module_code, run_module
|
from runpy import _run_module_code, run_module
|
||||||
|
|
||||||
# Set up the test code and expected results
|
# Set up the test code and expected results
|
||||||
|
|
@ -156,6 +156,7 @@ class RunModuleTest(unittest.TestCase):
|
||||||
def _check_module(self, depth):
|
def _check_module(self, depth):
|
||||||
pkg_dir, mod_fname, mod_name = (
|
pkg_dir, mod_fname, mod_name = (
|
||||||
self._make_pkg("x=1\n", depth))
|
self._make_pkg("x=1\n", depth))
|
||||||
|
forget(mod_name)
|
||||||
try:
|
try:
|
||||||
if verbose: print "Running from source:", mod_name
|
if verbose: print "Running from source:", mod_name
|
||||||
d1 = run_module(mod_name) # Read from source
|
d1 = run_module(mod_name) # Read from source
|
||||||
|
|
|
||||||
|
|
@ -832,6 +832,10 @@ Extension Modules
|
||||||
Tests
|
Tests
|
||||||
-----
|
-----
|
||||||
|
|
||||||
|
- Make test_runpy reentrant by fixing _check_module to clear out any module
|
||||||
|
being tested. Was causing an error by __import__ doing a reload on the
|
||||||
|
second run and thus suppressing bytecode recreation.
|
||||||
|
|
||||||
- Capture socket connection resets and timeouts in test_socket_ssl and
|
- Capture socket connection resets and timeouts in test_socket_ssl and
|
||||||
test_urllib2net and raise test.test_support.ResourceDenied.
|
test_urllib2net and raise test.test_support.ResourceDenied.
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue