[New-bugs-announce] [issue37460] importlib.import_module("test.test_curses") could not import by libregrtest

Yoong Hor Meng report at bugs.python.org
Sun Jun 30 23:15:50 EDT 2019


New submission from Yoong Hor Meng <yoonghm at gmail.com>:

test_curses.py was skipped during unit test.  I manually ran the test via debugger:

python3 -m pdb /home/s/lib/python3.8/test/regrtest.py test_curses 

It showed error at 

../lib/python3.8/test/libregrtest/runtest.py(215)_runtest_inner2():

210         abstest = get_abs_module(ns, test_name)                                                                                      211                                                                                                                                      212         # remove the module from sys.module to reload it if it was already imported                                                  213         support.unload(abstest)                                                                                                      214                                                                                                                                      215  ->     the_module = importlib.import_module(abstest)                                                                                216                                                                                                                                      217         # If the test has a test_main, that will run the appropriate                                                                 218         # tests.  If not, use normal unittest test loading.                                                                          219         test_runner = getattr(the_module, "test_main", None)                                                                         220         if test_runner is None:            

test.support.ResourceDenied: Use of the 'curses' resource not enabled 

However, it was possible to load the module

import importlib
the_module = importlib.import_module('test.test_curses')
print(the_module)

----------
components: Library (Lib)
messages: 346952
nosy: yoonghm
priority: normal
severity: normal
status: open
title: importlib.import_module("test.test_curses") could not import by libregrtest
versions: Python 3.8

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue37460>
_______________________________________


More information about the New-bugs-announce mailing list