Browse Source

More concessions for Python 3.5 compatibility.

Dan Helfman 6 years ago
parent
commit
fef441a8ff
1 changed files with 7 additions and 7 deletions
  1. 7 7
      tests/end-to-end/test_borgmatic.py

+ 7 - 7
tests/end-to-end/test_borgmatic.py

@@ -11,7 +11,9 @@ def generate_configuration(config_path, repository_path):
     Generate borgmatic configuration into a file at the config path, and update the defaults so as
     Generate borgmatic configuration into a file at the config path, and update the defaults so as
     to work for testing (including injecting the given repository path).
     to work for testing (including injecting the given repository path).
     '''
     '''
-    subprocess.check_call('generate-borgmatic-config --destination {}'.format(config_path).split(' '))
+    subprocess.check_call(
+        'generate-borgmatic-config --destination {}'.format(config_path).split(' ')
+    )
     config = (
     config = (
         open(config_path)
         open(config_path)
         .read()
         .read()
@@ -42,9 +44,8 @@ def test_borgmatic_command():
         # Run borgmatic to generate a backup archive, and then list it to make sure it exists.
         # Run borgmatic to generate a backup archive, and then list it to make sure it exists.
         subprocess.check_call('borgmatic --config {}'.format(config_path).split(' '))
         subprocess.check_call('borgmatic --config {}'.format(config_path).split(' '))
         output = subprocess.check_output(
         output = subprocess.check_output(
-            'borgmatic --config {} --list --json'.format(config_path).split(' '),
-            encoding=sys.stdout.encoding,
-        )
+            'borgmatic --config {} --list --json'.format(config_path).split(' ')
+        ).decode(sys.stdout.encoding)
         parsed_output = json.loads(output)
         parsed_output = json.loads(output)
 
 
         assert len(parsed_output) == 1
         assert len(parsed_output) == 1
@@ -52,9 +53,8 @@ def test_borgmatic_command():
 
 
         # Also exercise the info flag.
         # Also exercise the info flag.
         output = subprocess.check_output(
         output = subprocess.check_output(
-            'borgmatic --config {} --info --json'.format(config_path).split(' '),
-            encoding=sys.stdout.encoding,
-        )
+            'borgmatic --config {} --info --json'.format(config_path).split(' ')
+        ).decode(sys.stdout.encoding)
         parsed_output = json.loads(output)
         parsed_output = json.loads(output)
 
 
         assert len(parsed_output) == 1
         assert len(parsed_output) == 1