This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author pablogsal
Recipients eric.snow, gregory.p.smith, josh.r, lisroach, ncoghlan, pablogsal, pitrou, rhettinger, serhiy.storchaka, yselivanov
Date 2018-01-31.13:57:42
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1517407062.22.0.467229070634.issue31356@psf.upfronthosting.co.za>
In-reply-to
Content
@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.
History
Date User Action Args
2018-01-31 13:57:42pablogsalsetrecipients: + pablogsal, rhettinger, gregory.p.smith, ncoghlan, pitrou, eric.snow, serhiy.storchaka, yselivanov, josh.r, lisroach
2018-01-31 13:57:42pablogsalsetmessageid: <1517407062.22.0.467229070634.issue31356@psf.upfronthosting.co.za>
2018-01-31 13:57:42pablogsallinkissue31356 messages
2018-01-31 13:57:42pablogsalcreate