diff options
| author | Ezio Melotti <ezio.melotti@gmail.com> | 2010-01-24 16:58:36 (GMT) |
|---|---|---|
| committer | Ezio Melotti <ezio.melotti@gmail.com> | 2010-01-24 16:58:36 (GMT) |
| commit | b0f5adc3f4e098b1744eeac65fc830fb1df2b8ab (patch) | |
| tree | e2936db9f8e1194464aeb7e9546d5a892f7239c7 /Lib/test/test_tempfile.py | |
| parent | f14c7fc33da8ba3aa28bbb7b0305ea12ab30be09 (diff) | |
| download | cpython-b0f5adc3f4e098b1744eeac65fc830fb1df2b8ab.zip cpython-b0f5adc3f4e098b1744eeac65fc830fb1df2b8ab.tar.gz cpython-b0f5adc3f4e098b1744eeac65fc830fb1df2b8ab.tar.bz2 | |
use assert[Not]IsInstance where appropriate
Diffstat (limited to 'Lib/test/test_tempfile.py')
| -rw-r--r-- | Lib/test/test_tempfile.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/Lib/test/test_tempfile.py b/Lib/test/test_tempfile.py index b94acda..a358210 100644 --- a/Lib/test/test_tempfile.py +++ b/Lib/test/test_tempfile.py @@ -142,8 +142,7 @@ class test__candidate_tempdir_list(TC): self.assertFalse(len(cand) == 0) for c in cand: - self.assertTrue(isinstance(c, basestring), - "%s is not a string" % c) + self.assertIsInstance(c, basestring) def test_wanted_dirs(self): # _candidate_tempdir_list contains the expected directories @@ -184,7 +183,7 @@ class test__get_candidate_names(TC): def test_retval(self): # _get_candidate_names returns a _RandomNameSequence object obj = tempfile._get_candidate_names() - self.assertTrue(isinstance(obj, tempfile._RandomNameSequence)) + self.assertIsInstance(obj, tempfile._RandomNameSequence) def test_same_thing(self): # _get_candidate_names always returns the same object @@ -322,7 +321,7 @@ class test_gettempprefix(TC): # gettempprefix returns a nonempty prefix string p = tempfile.gettempprefix() - self.assertTrue(isinstance(p, basestring)) + self.assertIsInstance(p, basestring) self.assertTrue(len(p) > 0) def test_usable_template(self): |
