summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_weakref.py
Commit message (Collapse)AuthorAgeFilesLines
* bpo-32746: Fix multiple typos (GH-5144)Leo Arias2018-02-041-1/+1
| | | Fix typos found by codespell in docs, docstrings, and comments.
* bpo-31370: Remove support for threads-less builds (#3385)Antoine Pitrou2017-09-071-1/+1
| | | | | | * Remove Setup.config * Always define WITH_THREAD for compatibility.
* Issue #28427: old keys should not remove new values fromAntoine Pitrou2016-12-271-0/+12
|\ | | | | | | WeakValueDictionary when collecting from another thread.
| * Issue #28427: old keys should not remove new values fromAntoine Pitrou2016-12-271-0/+12
| | | | | | | | WeakValueDictionary when collecting from another thread.
* | Issue #19542: Fix bugs in WeakValueDictionary.setdefault() and ↵Antoine Pitrou2016-12-191-0/+41
|\ \ | |/ | | | | | | | | | | | | WeakValueDictionary.pop() when a GC collection happens in another thread. Original patch and report by Armin Rigo.
| * Issue #19542: Fix bugs in WeakValueDictionary.setdefault() and ↵Antoine Pitrou2016-12-191-0/+41
| | | | | | | | | | | | | | | | WeakValueDictionary.pop() when a GC collection happens in another thread. Original patch and report by Armin Rigo.
* | merge 3.5 (#26617)Benjamin Peterson2016-10-041-0/+8
|\ \ | |/
| * ensure gc tracking is off when invoking weakref callbacks (closes #26617)Benjamin Peterson2016-10-041-0/+8
| |
* | Implement compact dictVictor Stinner2016-09-081-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | Issue #27350: `dict` implementation is changed like PyPy. It is more compact and preserves insertion order. _PyDict_Dummy() function has been removed. Disable test_gdb: python-gdb.py is not updated yet to the new structure of compact dictionaries (issue #28023). Patch written by INADA Naoki.
* | Correct a comment in the test referencing the wrong issue number (issue3100Gregory P. Smith ext:(%20%5BGoogle%20Inc.%5D)2016-09-071-1/+1
|/ | | | is correct, not 3110).
* Issue #19527: Fixed tests with defined COUNT_ALLOCS.Serhiy Storchaka2016-07-031-0/+1
|
* Issue #17765: weakref.ref() no longer silently ignores keyword arguments.Serhiy Storchaka2016-05-071-0/+4
| | | | Patch by Georg Brandl.
* Issue #25523: Merge "a" to "an" fixes from 3.4 into 3.5Martin Panter2015-11-021-1/+1
|\
| * Issue #25523: Correct "a" article to "an" articleMartin Panter2015-11-021-1/+1
| | | | | | | | | | | | This changes the main documentation, doc strings, source code comments, and a couple error messages in the test suite. In some cases the word was removed or edited some other way to fix the grammar.
* | Issue #22958: Constructor and update method of weakref.WeakValueDictionarySerhiy Storchaka2015-09-291-0/+25
|\ \ | |/ | | | | now accept the self and the dict keyword arguments.
| * Issue #22958: Constructor and update method of weakref.WeakValueDictionarySerhiy Storchaka2015-09-291-0/+25
| | | | | | | | now accept the self and the dict keyword arguments.
* | Issue #9517: Move script_helper to the support package.Berker Peksag2015-05-061-1/+2
| | | | | | | | Patch by Christie Wilson.
* | Closes #21173: Fix len() on a WeakKeyDictionary when .clear() was called ↵Antoine Pitrou2014-10-051-0/+36
|\ \ | |/ | | | | with an iterator alive.
| * Closes #21173: Fix len() on a WeakKeyDictionary when .clear() was called ↵Antoine Pitrou2014-10-051-0/+36
| | | | | | | | with an iterator alive.
* | merge 3.4 (#22267)Benjamin Peterson2014-08-241-0/+2
|\ \ | |/
| * fix some test_weakref tests to not rely on ref-counting (closes #22267)Benjamin Peterson2014-08-241-0/+2
| |
* | Issue #22116: C functions and methods (of the 'builtin_function_or_method' ↵Antoine Pitrou2014-08-061-0/+12
| | | | | | | | type) can now be weakref'ed. Patch by Wei Wu.
* | Issue #22031: Reprs now always use hexadecimal format with the "0x" prefixSerhiy Storchaka2014-07-221-0/+8
|/ | | | when contain an id in form " at 0x...".
* Issue #19607: Use specific asserts in weakref tests.Serhiy Storchaka2013-11-171-65/+62
|\
| * Issue #19607: Use specific asserts in weakref tests.Serhiy Storchaka2013-11-171-65/+62
| |
* | Issue #15528: Add weakref.finalize to support finalization usingRichard Oudkerk2013-05-051-1/+151
| | | | | | | | | | | | | | | | | | weakref callbacks. This is 2e446e87ac5b except that collections/__init__.py has been modified to import proxy from _weakref instead of weakref. This eliminates an import cycle which seems to cause a problem on Unix but not Windows.
* | Backout 2e446e87ac5b; it breaks the unix buildbots.Richard Oudkerk2013-05-051-151/+1
| |
* | Issue #15528: Add weakref.finalize to support finalization usingRichard Oudkerk2013-05-051-1/+151
| | | | | | | | weakref callbacks.
* | Issue #17643: Add __callback__ attribute to weakref.ref.Mark Dickinson2013-04-131-0/+24
| |
* | Issue #16602: When a weakref's target was part of a long deallocation chain, ↵Antoine Pitrou2012-12-081-0/+21
|\ \ | |/ | | | | | | | | the object could remain reachable through its weakref even though its refcount had dropped to zero. Thanks to Eugene Toder for diagnosing and reporting the issue.
| * Issue #16602: When a weakref's target was part of a long deallocation chain, ↵Antoine Pitrou2012-12-081-0/+21
| | | | | | | | | | | | the object could remain reachable through its weakref even though its refcount had dropped to zero. Thanks to Eugene Toder for diagnosing and reporting the issue.
* | Issue #14631: Add a new :class:`weakref.WeakMethod` to simulate weak ↵Antoine Pitrou2012-11-171-0/+140
|/ | | | references to bound methods.
* Issue #16453: Fix equality testing of dead weakref objects.Antoine Pitrou2012-11-111-21/+84
| | | | Also add tests for ordering and hashing.
* Issue #14159: Fix the len() of weak containers (WeakSet, WeakKeyDictionary, ↵Antoine Pitrou2012-03-011-0/+60
| | | | | | | WeakValueDictionary) to return a better approximation when some objects are dead or dying. Moreover, the implementation is now O(1) rather than O(n). Thanks to Yury Selivanov for reporting.
* NOTE: only ported the test for new-style classes.Antoine Pitrou2010-03-311-0/+12
| | | | | | | | | | | | Merged revisions 79535 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r79535 | antoine.pitrou | 2010-03-31 23:32:15 +0200 (mer., 31 mars 2010) | 5 lines Issue #8268: Old-style classes (not just instances) now support weak references. ........
* use assert[Not]In where appropriateEzio Melotti2010-01-231-9/+6
|
* use assert[Not]In where appropriateBenjamin Peterson2010-01-191-13/+13
| | | | A patch from Dave Malcolm.
* Issue #7105: Make WeakKeyDictionary and WeakValueDictionary robust againstAntoine Pitrou2010-01-081-0/+87
| | | | the destruction of weakref'ed objects while iterating.
* fix __bytes__ handling here in py3xBenjamin Peterson2009-11-191-0/+11
| | | | | | | | | | | Merged revisions 76395 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r76395 | benjamin.peterson | 2009-11-18 21:00:02 -0600 (Wed, 18 Nov 2009) | 1 line #5037 proxy __unicode__ correctly ........
* convert old fail* assertions to assert*Benjamin Peterson2009-06-301-82/+82
|
* Issue #6149: Fix initialization of WeakValueDictionary objects from ↵Antoine Pitrou2009-05-301-0/+11
| | | | non-empty parameters.
* Merged revisions 66337,66347,66350,66352,66358 via svnmerge fromBenjamin Peterson2008-09-101-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r66337 | vinay.sajip | 2008-09-09 08:42:08 -0500 (Tue, 09 Sep 2008) | 1 line Issue #3809: Fixed spurious 'test.blah' file left behind by test_logging. ........ r66347 | georg.brandl | 2008-09-09 14:26:00 -0500 (Tue, 09 Sep 2008) | 2 lines Fix varname in docstring. #3822. ........ r66350 | georg.brandl | 2008-09-09 15:28:31 -0500 (Tue, 09 Sep 2008) | 2 lines #3472: update Mac-bundled Python version info. ........ r66352 | benjamin.peterson | 2008-09-09 15:55:01 -0500 (Tue, 09 Sep 2008) | 4 lines Fix #3634 invalid return value from _weakref.ref(Exception).__init__ Reviewers: Amaury, Antoine, Benjamin ........ r66358 | benjamin.peterson | 2008-09-09 18:16:48 -0500 (Tue, 09 Sep 2008) | 1 line use the latest pygments version ........
* Committing the patch in issue 2965, so that weakref dicts have a closerBarry Warsaw2008-09-041-12/+12
| | | | | interface to normal dictionaries. keys(), values() and items() still return iterators instead of views, but that can be fixed later (or not).
* Merged revisions 64309 via svnmerge fromAmaury Forgeot d'Arc2008-06-161-1/+40
| | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r64309 | amaury.forgeotdarc | 2008-06-16 21:12:42 +0200 (lun., 16 juin 2008) | 8 lines Issue 3110: Crash with weakref subclass, seen after a "import multiprocessing.reduction" An instance of a weakref subclass can have attributes. If such a weakref holds the only strong reference to the object, deleting the weakref will delete the object. In this case, the callback must not be called, because the ref object is being deleted! ........
* Merged revisions ↵Georg Brandl2008-05-251-1/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 63412,63445-63447,63449-63450,63452,63454,63459,63463,63465,63470,63483-63484,63496-63497,63499-63501,63530-63531,63540,63614 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r63412 | georg.brandl | 2008-05-17 19:57:01 +0200 (Sat, 17 May 2008) | 2 lines #961805: fix Edit.text_modified(). ........ r63445 | georg.brandl | 2008-05-18 10:52:59 +0200 (Sun, 18 May 2008) | 2 lines GHOP #180 by Michael Schneider: add examples to the socketserver documentation. ........ r63446 | georg.brandl | 2008-05-18 11:12:20 +0200 (Sun, 18 May 2008) | 2 lines GHOP #134, #171, #137: unit tests for the three HTTPServer modules. ........ r63447 | georg.brandl | 2008-05-18 12:39:26 +0200 (Sun, 18 May 2008) | 3 lines Take namedtuple item names only from ascii_letters (this blew up on OSX), and make sure there are no duplicate names. ........ r63449 | georg.brandl | 2008-05-18 13:46:51 +0200 (Sun, 18 May 2008) | 2 lines GHOP #217: add support for compiling Python with coverage checking enabled. ........ r63450 | georg.brandl | 2008-05-18 13:52:36 +0200 (Sun, 18 May 2008) | 2 lines GHOP #257: test distutils' build_ext command, written by Josip Dzolonga. ........ r63452 | georg.brandl | 2008-05-18 15:34:06 +0200 (Sun, 18 May 2008) | 2 lines Add GHOP students. ........ r63454 | georg.brandl | 2008-05-18 18:32:48 +0200 (Sun, 18 May 2008) | 2 lines GHOP #121: improve test_pydoc, by Benjamin Peterson. ........ r63459 | benjamin.peterson | 2008-05-18 22:48:07 +0200 (Sun, 18 May 2008) | 2 lines bring test_pydoc up to my high standards (now that I have them) ........ r63463 | georg.brandl | 2008-05-18 23:10:19 +0200 (Sun, 18 May 2008) | 2 lines Fix test_pyclbr after another platform-dependent function was added to urllib. ........ r63465 | benjamin.peterson | 2008-05-19 01:07:07 +0200 (Mon, 19 May 2008) | 2 lines change some imports in tests so they will not be skipped in 3.0 ........ r63470 | georg.brandl | 2008-05-19 18:47:25 +0200 (Mon, 19 May 2008) | 2 lines test_httpservers has unpredictable refcount behavior. ........ r63483 | georg.brandl | 2008-05-20 08:15:36 +0200 (Tue, 20 May 2008) | 2 lines Activate two more test cases in test_httpservers. ........ r63484 | georg.brandl | 2008-05-20 08:47:31 +0200 (Tue, 20 May 2008) | 2 lines Argh, this is the *actual* test that works under Windows. ........ r63496 | georg.brandl | 2008-05-20 10:07:36 +0200 (Tue, 20 May 2008) | 2 lines Improve diffing logic and output for test_pydoc. ........ r63497 | georg.brandl | 2008-05-20 10:10:03 +0200 (Tue, 20 May 2008) | 2 lines Use inspect.getabsfile() to get the documented module's filename. ........ r63499 | georg.brandl | 2008-05-20 10:25:48 +0200 (Tue, 20 May 2008) | 3 lines Patch #1775025: allow opening zipfile members via ZipInfo instances. Patch by Graham Horler. ........ r63500 | georg.brandl | 2008-05-20 10:40:43 +0200 (Tue, 20 May 2008) | 2 lines #2592: delegate nb_index and the floor/truediv slots in weakref.proxy. ........ r63501 | georg.brandl | 2008-05-20 10:48:34 +0200 (Tue, 20 May 2008) | 2 lines #615772: raise a more explicit error from Tkinter.Misc.__contains__. ........ r63530 | benjamin.peterson | 2008-05-22 02:57:02 +0200 (Thu, 22 May 2008) | 2 lines use more specific asserts in test_opcode ........ r63531 | benjamin.peterson | 2008-05-22 03:02:23 +0200 (Thu, 22 May 2008) | 2 lines remove redundant invocation of json doctests ........ r63540 | benjamin.peterson | 2008-05-23 01:09:26 +0200 (Fri, 23 May 2008) | 3 lines fix test_pydoc so it works on make installed Python installations Also let it pass when invoked directly ........ r63614 | georg.brandl | 2008-05-25 10:07:37 +0200 (Sun, 25 May 2008) | 2 lines #2959: allow multiple close() calls for GzipFile. ........
* #2621 rename test.test_support to test.supportBenjamin Peterson2008-05-201-3/+3
|
* Move UserList to collections.Raymond Hettinger2008-02-121-4/+4
|
* Patch from Georg Brandl and me for #1493Christian Heimes2007-11-251-5/+0
| | | | Remove unbound method objects
* Patch by Christian Heimes to change self.assert_(x == y) intoGuido van Rossum2007-07-111-14/+14
| | | | | self.assertEqual(x, y). (Christian used self.failUnlessEqual(), but the double negative makes it hard to grok, so I changed it.)
* Merged revisions 56125-56153 via svnmerge fromGuido van Rossum2007-07-031-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/branches/p3yk ........ r56127 | georg.brandl | 2007-06-30 09:32:49 +0200 (Sat, 30 Jun 2007) | 2 lines Fix a place where floor division would be in order. ........ r56135 | guido.van.rossum | 2007-07-01 06:13:54 +0200 (Sun, 01 Jul 2007) | 28 lines Make map() and filter() identical to itertools.imap() and .ifilter(), respectively. I fixed two bootstrap issues, due to the dynamic import of itertools: 1. Starting python requires that map() and filter() are not used until site.py has added build/lib.<arch> to sys.path. 2. Building python requires that setup.py and distutils and everything they use is free of map() and filter() calls. Beyond this, I only fixed the tests in test_builtin.py. Others, please help fixing the remaining tests that are now broken! The fixes are usually simple: a. map(None, X) -> list(X) b. map(F, X) -> list(map(F, X)) c. map(lambda x: F(x), X) -> [F(x) for x in X] d. filter(F, X) -> list(filter(F, X)) e. filter(lambda x: P(x), X) -> [x for x in X if P(x)] Someone, please also contribute a fixer for 2to3 to do this. It can leave map()/filter() calls alone that are already inside a list() or sorted() call or for-loop. Only in rare cases have I seen code that depends on map() of lists of different lengths going to the end of the longest, or on filter() of a string or tuple returning an object of the same type; these will need more thought to fix. ........ r56136 | guido.van.rossum | 2007-07-01 06:22:01 +0200 (Sun, 01 Jul 2007) | 3 lines Make it so that test_decimal fails instead of hangs, to help automated test runners. ........ r56139 | georg.brandl | 2007-07-01 18:20:58 +0200 (Sun, 01 Jul 2007) | 2 lines Fix a few test cases after the map->imap change. ........ r56142 | neal.norwitz | 2007-07-02 06:38:12 +0200 (Mon, 02 Jul 2007) | 1 line Get a bunch more tests passing after converting map/filter to return iterators. ........ r56147 | guido.van.rossum | 2007-07-02 15:32:02 +0200 (Mon, 02 Jul 2007) | 4 lines Fix the remaining failing unit tests (at least on OSX). Also tweaked urllib2 so it doesn't raise socket.gaierror when all network interfaces are turned off. ........