mirror of
https://github.com/python/cpython.git
synced 2025-09-26 10:19:53 +00:00
Change signature of packaging.tests.support.LoggingCatcher.get_logs.
I need this for some tests, and it makes code clearer. This commit also changes some assertEqual calls to use (actual, expected) order and fix some pyflakes warnings.
This commit is contained in:
parent
4b5a5f7bd5
commit
382067b3cf
10 changed files with 65 additions and 72 deletions
|
@ -2,7 +2,6 @@
|
|||
import os
|
||||
import zipfile
|
||||
import tarfile
|
||||
import logging
|
||||
|
||||
from packaging.tests.support import requires_zlib
|
||||
|
||||
|
@ -221,7 +220,7 @@ class SDistTestCase(support.TempdirManager,
|
|||
# with the check subcommand
|
||||
cmd.ensure_finalized()
|
||||
cmd.run()
|
||||
warnings = self.get_logs(logging.WARN)
|
||||
warnings = self.get_logs()
|
||||
self.assertEqual(len(warnings), 4)
|
||||
|
||||
# trying with a complete set of metadata
|
||||
|
@ -230,13 +229,10 @@ class SDistTestCase(support.TempdirManager,
|
|||
cmd.ensure_finalized()
|
||||
cmd.metadata_check = False
|
||||
cmd.run()
|
||||
warnings = self.get_logs(logging.WARN)
|
||||
# removing manifest generated warnings
|
||||
warnings = [warn for warn in warnings if
|
||||
not warn.endswith('-- skipping')]
|
||||
# the remaining warnings are about the use of the default file list and
|
||||
# the absence of setup.cfg
|
||||
warnings = self.get_logs()
|
||||
self.assertEqual(len(warnings), 2)
|
||||
self.assertIn('using default file list', warnings[0])
|
||||
self.assertIn("'setup.cfg' file not found", warnings[1])
|
||||
|
||||
def test_show_formats(self):
|
||||
__, stdout = captured_stdout(show_formats)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue