Message311331
@lisroach A possible test for this is repeat `test_ensure_disabled_thread` with warnings as errors:
```python
warnings.filterwarnings('error')
```
and then checking for a `RuntimeWarning` exception instead of the warning. I think this will work because without the changes in this PR, this proposed test will produce this error:
```python
======================================================================
ERROR: test_ensure_disabled_thread (Lib.test.test_gc.GCTogglingTests)
----------------------------------------------------------------------
RuntimeWarning: Garbage collector enabled while another thread is inside gc.ensure_enabled
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/pgalindo3/cpython/Lib/test/support/__init__.py", line 2083, in decorator
return func(*args)
File "/home/pgalindo3/cpython/Lib/test/test_gc.py", line 1063, in test_ensure_disabled_thread
inside_status_after_thread = gc.isenabled()
SystemError: <built-in method __exit__ of gc.ensure_disabled object at 0x7f0253d22de0> returned a result with an error se
```
Another posible test is checking that SystemError is not raised / in stderr. |
|
Date |
User |
Action |
Args |
2018-01-31 13:57:42 | pablogsal | set | recipients:
+ pablogsal, rhettinger, gregory.p.smith, ncoghlan, pitrou, eric.snow, serhiy.storchaka, yselivanov, josh.r, lisroach |
2018-01-31 13:57:42 | pablogsal | set | messageid: <1517407062.22.0.467229070634.issue31356@psf.upfronthosting.co.za> |
2018-01-31 13:57:42 | pablogsal | link | issue31356 messages |
2018-01-31 13:57:42 | pablogsal | create | |
|