summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBerker Peksag <berker.peksag@gmail.com>2014-11-24 21:57:00 (GMT)
committerBerker Peksag <berker.peksag@gmail.com>2014-11-24 21:57:00 (GMT)
commitdfdae021b93bb7d8d8d64ee9379e77c34709fd75 (patch)
treede674ff66a07d1d88ba549cea439440b41fe326b
parent8a9c682d41a3ad414128a9a2697542aa8c30ac11 (diff)
downloadcpython-dfdae021b93bb7d8d8d64ee9379e77c34709fd75.zip
cpython-dfdae021b93bb7d8d8d64ee9379e77c34709fd75.tar.gz
cpython-dfdae021b93bb7d8d8d64ee9379e77c34709fd75.tar.bz2
Issue #16056: Rename test methods to avoid conflict.
-rw-r--r--Lib/test/test_ftplib.py4
-rw-r--r--Lib/test/test_unicode.py2
-rw-r--r--Lib/test/test_weakset.py54
3 files changed, 1 insertions, 59 deletions
diff --git a/Lib/test/test_ftplib.py b/Lib/test/test_ftplib.py
index b3d8f7e..952ac99 100644
--- a/Lib/test/test_ftplib.py
+++ b/Lib/test/test_ftplib.py
@@ -484,10 +484,6 @@ class TestFTPClass(TestCase):
dir = self.client.cwd('/foo')
self.assertEqual(dir, '250 cwd ok')
- def test_mkd(self):
- dir = self.client.mkd('/foo')
- self.assertEqual(dir, '/foo')
-
def test_pwd(self):
dir = self.client.pwd()
self.assertEqual(dir, 'pwd ok')
diff --git a/Lib/test/test_unicode.py b/Lib/test/test_unicode.py
index bafd066..9f6cc75 100644
--- a/Lib/test/test_unicode.py
+++ b/Lib/test/test_unicode.py
@@ -484,7 +484,7 @@ class UnicodeTest(
u'X\U00010427X\U00010427')
@requires_wide_build
- def test_capitalize(self):
+ def test_capitalize_wide_build(self):
string_tests.CommonTest.test_capitalize(self)
self.assertEqual(u'\U0001044F'.capitalize(), u'\U00010427')
self.assertEqual(u'\U0001044F\U0001044F'.capitalize(),
diff --git a/Lib/test/test_weakset.py b/Lib/test/test_weakset.py
index d735d9c..fb9e8d7 100644
--- a/Lib/test/test_weakset.py
+++ b/Lib/test/test_weakset.py
@@ -11,7 +11,6 @@ import warnings
import collections
import gc
import contextlib
-from UserString import UserString as ustr
class Foo:
@@ -449,59 +448,6 @@ class TestWeakSet(unittest.TestCase):
self.assertGreaterEqual(n2, 0)
self.assertLessEqual(n2, n1)
- def test_weak_destroy_while_iterating(self):
- # Issue #7105: iterators shouldn't crash when a key is implicitly removed
- # Create new items to be sure no-one else holds a reference
- items = [ustr(c) for c in ('a', 'b', 'c')]
- s = WeakSet(items)
- it = iter(s)
- next(it) # Trigger internal iteration
- # Destroy an item
- del items[-1]
- gc.collect() # just in case
- # We have removed either the first consumed items, or another one
- self.assertIn(len(list(it)), [len(items), len(items) - 1])
- del it
- # The removal has been committed
- self.assertEqual(len(s), len(items))
-
- def test_weak_destroy_and_mutate_while_iterating(self):
- # Issue #7105: iterators shouldn't crash when a key is implicitly removed
- items = [ustr(c) for c in string.ascii_letters]
- s = WeakSet(items)
- @contextlib.contextmanager
- def testcontext():
- try:
- it = iter(s)
- # Start iterator
- yielded = ustr(str(next(it)))
- # Schedule an item for removal and recreate it
- u = ustr(str(items.pop()))
- if yielded == u:
- # The iterator still has a reference to the removed item,
- # advance it (issue #20006).
- next(it)
- gc.collect() # just in case
- yield u
- finally:
- it = None # should commit all removals
-
- with testcontext() as u:
- self.assertFalse(u in s)
- with testcontext() as u:
- self.assertRaises(KeyError, s.remove, u)
- self.assertFalse(u in s)
- with testcontext() as u:
- s.add(u)
- self.assertTrue(u in s)
- t = s.copy()
- with testcontext() as u:
- s.update(t)
- self.assertEqual(len(s), len(t))
- with testcontext() as u:
- s.clear()
- self.assertEqual(len(s), 0)
-
def test_main(verbose=None):
test_support.run_unittest(TestWeakSet)