[New-bugs-announce] [issue36160] Multiple errors in test_site.py on sysconfig._CONFIG_VARS.clear() if run on its own

Ivan Pozdeev report at bugs.python.org
Fri Mar 1 13:39:20 EST 2019


New submission from Ivan Pozdeev <ivan_pozdeev at mail.ru>:

Sample failure:

> cpython\branches\3.7>python.bat -m test.test_site

Running Debug|x64 interpreter...
EEEEEEEEEEEEE.s.............
======================================================================
ERROR: test_addpackage (__main__.HelperFunctionsTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Users\Sasha\Documents\cpython\branches\3.7\lib\test\test_site.py", li
ne 77, in tearDown
    sysconfig._CONFIG_VARS.clear()
AttributeError: 'NoneType' object has no attribute 'clear'

======================================================================
ERROR: test_addpackage_import_bad_exec (__main__.HelperFunctionsTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Users\Sasha\Documents\cpython\branches\3.7\lib\test\test_site.py", li
ne 77, in tearDown
    sysconfig._CONFIG_VARS.clear()
AttributeError: 'NoneType' object has no attribute 'clear'

<etc>

The reason is that `sysconfig._CONFIG_VARS' is None until the first call to `sysconfig.get_config_vars()'. When the suite is used in conjunction with the others, other tests have already called it by the time test_site.py gets control.

----------
components: Tests
messages: 336947
nosy: Ivan.Pozdeev
priority: normal
severity: normal
status: open
title: Multiple errors in test_site.py on sysconfig._CONFIG_VARS.clear() if run on its own
type: behavior
versions: Python 3.7, Python 3.8

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


More information about the New-bugs-announce mailing list