From 687cb38a05414f1e1fe6b255735d998bfc9741b4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Freitag?= Date: Sat, 25 Apr 2020 22:20:20 +0200 Subject: [PATCH] Removed unnecessary capturing/hiding of stdout/stderr in various tests. --- tests/admin_scripts/tests.py | 5 ++--- tests/migrations/test_commands.py | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/tests/admin_scripts/tests.py b/tests/admin_scripts/tests.py index 222d55f023..d0af160c5f 100644 --- a/tests/admin_scripts/tests.py +++ b/tests/admin_scripts/tests.py @@ -1366,8 +1366,7 @@ class ManageTestserver(SimpleTestCase): @mock.patch.object(LoaddataCommand, 'handle', return_value='') @mock.patch.object(RunserverCommand, 'handle', return_value='') def test_params_to_runserver(self, mock_runserver_handle, mock_loaddata_handle, mock_create_test_db): - out = StringIO() - call_command('testserver', 'blah.json', stdout=out) + call_command('testserver', 'blah.json') mock_runserver_handle.assert_called_with( addrport='', force_color=False, @@ -1678,7 +1677,7 @@ class CommandTypes(AdminScriptTestCase): A command called from the command line should close connections after being executed (#21255). """ - command = BaseCommand(stderr=StringIO()) + command = BaseCommand() command.check = lambda: [] command.handle = lambda *args, **kwargs: args with mock.patch('django.core.management.base.connections') as mock_connections: diff --git a/tests/migrations/test_commands.py b/tests/migrations/test_commands.py index 2ecf584622..496cdb00cf 100644 --- a/tests/migrations/test_commands.py +++ b/tests/migrations/test_commands.py @@ -254,7 +254,7 @@ class MigrateTests(MigrationTestBase): }) def test_migrate_check(self): with self.assertRaises(SystemExit): - call_command('migrate', 'migrations', '0001', check_unapplied=True, verbosity=0) + call_command('migrate', 'migrations', '0001', check_unapplied=True) self.assertTableNotExists('migrations_author') self.assertTableNotExists('migrations_tribble') self.assertTableNotExists('migrations_book')