Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(35311)

Side by Side Diff: Lib/distutils/tests/test_archive_util.py

Issue 19600: Use specific asserts in distutils tests
Patch Set: Created 5 years, 10 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | Lib/distutils/tests/test_bdist_rpm.py » ('j') | Lib/distutils/tests/test_clean.py » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # -*- coding: utf-8 -*- 1 # -*- coding: utf-8 -*-
2 """Tests for distutils.archive_util.""" 2 """Tests for distutils.archive_util."""
3 import unittest 3 import unittest
4 import os 4 import os
5 import sys 5 import sys
6 import tarfile 6 import tarfile
7 from os.path import splitdrive 7 from os.path import splitdrive
8 import warnings 8 import warnings
9 9
10 from distutils import archive_util 10 from distutils import archive_util
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 os.remove(tarball) 203 os.remove(tarball)
204 old_dir = os.getcwd() 204 old_dir = os.getcwd()
205 os.chdir(tmpdir) 205 os.chdir(tmpdir)
206 try: 206 try:
207 with check_warnings() as w: 207 with check_warnings() as w:
208 warnings.simplefilter("always") 208 warnings.simplefilter("always")
209 make_tarball(base_name, 'dist', compress='compress', 209 make_tarball(base_name, 'dist', compress='compress',
210 dry_run=True) 210 dry_run=True)
211 finally: 211 finally:
212 os.chdir(old_dir) 212 os.chdir(old_dir)
213 self.assertTrue(not os.path.exists(tarball)) 213 self.assertFalse(os.path.exists(tarball))
214 self.assertEqual(len(w.warnings), 1) 214 self.assertEqual(len(w.warnings), 1)
215 215
216 @unittest.skipUnless(ZIP_SUPPORT and ZLIB_SUPPORT, 216 @unittest.skipUnless(ZIP_SUPPORT and ZLIB_SUPPORT,
217 'Need zip and zlib support to run') 217 'Need zip and zlib support to run')
218 def test_make_zipfile(self): 218 def test_make_zipfile(self):
219 # creating something to tar 219 # creating something to tar
220 tmpdir = self.mkdtemp() 220 tmpdir = self.mkdtemp()
221 self.write_file([tmpdir, 'file1'], 'xxx') 221 self.write_file([tmpdir, 'file1'], 'xxx')
222 self.write_file([tmpdir, 'file2'], 'xxx') 222 self.write_file([tmpdir, 'file2'], 'xxx')
223 223
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 pass 273 pass
274 self.assertEqual(os.getcwd(), current_dir) 274 self.assertEqual(os.getcwd(), current_dir)
275 finally: 275 finally:
276 del ARCHIVE_FORMATS['xxx'] 276 del ARCHIVE_FORMATS['xxx']
277 277
278 def test_suite(): 278 def test_suite():
279 return unittest.makeSuite(ArchiveUtilTestCase) 279 return unittest.makeSuite(ArchiveUtilTestCase)
280 280
281 if __name__ == "__main__": 281 if __name__ == "__main__":
282 run_unittest(test_suite()) 282 run_unittest(test_suite())
OLDNEW
« no previous file with comments | « no previous file | Lib/distutils/tests/test_bdist_rpm.py » ('j') | Lib/distutils/tests/test_clean.py » ('J')

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+