mirror of
https://github.com/python/cpython.git
synced 2025-11-01 18:51:43 +00:00
Cleanups in distutils tests.
- Actually check the contents of the file created by bdist_dumb. - Don’t use “RECORD” as filename for non-PEP 376 record file - Don’t start method name with “_test”, it smells like a disabled test method instead of an helper method - Fix some idioms (assertIn, addCleanup)
This commit is contained in:
parent
91d5193b3a
commit
af2ffd75cf
3 changed files with 32 additions and 25 deletions
|
|
@ -288,7 +288,7 @@ class SDistTestCase(PyPIRCCommandTestCase):
|
|||
# the following tests make sure there is a nice error message instead
|
||||
# of a traceback when parsing an invalid manifest template
|
||||
|
||||
def _test_template(self, content):
|
||||
def _check_template(self, content):
|
||||
dist, cmd = self.get_cmd()
|
||||
os.chdir(self.tmp_dir)
|
||||
self.write_file('MANIFEST.in', content)
|
||||
|
|
@ -299,17 +299,17 @@ class SDistTestCase(PyPIRCCommandTestCase):
|
|||
self.assertEqual(len(warnings), 1)
|
||||
|
||||
def test_invalid_template_unknown_command(self):
|
||||
self._test_template('taunt knights *')
|
||||
self._check_template('taunt knights *')
|
||||
|
||||
def test_invalid_template_wrong_arguments(self):
|
||||
# this manifest command takes one argument
|
||||
self._test_template('prune')
|
||||
self._check_template('prune')
|
||||
|
||||
@unittest.skipIf(os.name != 'nt', 'test relevant for Windows only')
|
||||
def test_invalid_template_wrong_path(self):
|
||||
# on Windows, trailing slashes are not allowed
|
||||
# this used to crash instead of raising a warning: #8286
|
||||
self._test_template('include examples/')
|
||||
self._check_template('include examples/')
|
||||
|
||||
@unittest.skipUnless(ZLIB_SUPPORT, 'Need zlib support to run')
|
||||
def test_get_file_list(self):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue