summaryrefslogtreecommitdiff
path: root/tests/dbshell
diff options
context:
space:
mode:
Diffstat (limited to 'tests/dbshell')
-rw-r--r--tests/dbshell/test_oracle.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/tests/dbshell/test_oracle.py b/tests/dbshell/test_oracle.py
index d236a932ab..cfaf106d68 100644
--- a/tests/dbshell/test_oracle.py
+++ b/tests/dbshell/test_oracle.py
@@ -1,3 +1,4 @@
+from subprocess import CompletedProcess
from unittest import mock, skipUnless
from django.db import connection
@@ -9,13 +10,13 @@ from django.test import SimpleTestCase
class OracleDbshellTests(SimpleTestCase):
def _run_dbshell(self, rlwrap=False):
"""Run runshell command and capture its arguments."""
- def _mock_subprocess_call(*args):
- self.subprocess_args = tuple(*args)
- return 0
+ def _mock_subprocess_run(*args):
+ self.subprocess_args = list(*args)
+ return CompletedProcess(self.subprocess_args, 0)
client = DatabaseClient(connection)
self.subprocess_args = None
- with mock.patch('subprocess.call', new=_mock_subprocess_call):
+ with mock.patch('subprocess.run', new=_mock_subprocess_run):
with mock.patch('shutil.which', return_value='/usr/bin/rlwrap' if rlwrap else None):
client.runshell()
return self.subprocess_args