Merge lp:~jelmer/brz/diff-without-python into lp:brz

Proposed by Jelmer Vernooij on 2018-10-28
Status: Merged
Approved by: Jelmer Vernooij on 2018-10-28
Approved revision: 7143
Merge reported by: The Breezy Bot
Merged at revision: not available
Proposed branch: lp:~jelmer/brz/diff-without-python
Merge into: lp:brz
Diff against target: 51 lines (+4/-6)
2 files modified
breezy/tests/test_diff.py (+4/-3)
breezy/tests/test_mergetools.py (+0/-3)
To merge this branch: bzr merge lp:~jelmer/brz/diff-without-python
Reviewer Review Type Date Requested Status
Vincent Ladeuil 2018-10-28 Approve on 2018-10-28
Review via email: mp+357913@code.launchpad.net

Commit message

Use sys.executable rather than 'python' for ad-hoc tests.

Description of the change

Use sys.executable rather than 'python' for ad-hoc tests.

On some systems (e.g. Debian buildds), the 'python' executable may not be
available, but just 'python3'.

To post a comment you must log in.
lp:~jelmer/brz/diff-without-python updated on 2018-10-28
7143. By Jelmer Vernooij on 2018-10-28

Drop silly test.

Vincent Ladeuil (vila) wrote :

+1 on both commits ;)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'breezy/tests/test_diff.py'
2--- breezy/tests/test_diff.py 2018-07-11 21:06:20 +0000
3+++ breezy/tests/test_diff.py 2018-10-28 11:45:03 +0000
4@@ -17,6 +17,7 @@
5 import os
6 import re
7 import subprocess
8+import sys
9 import tempfile
10
11 from .. import (
12@@ -1430,7 +1431,7 @@
13
14 def test_execute(self):
15 output = BytesIO()
16- diff_obj = diff.DiffFromTool(['python', '-c',
17+ diff_obj = diff.DiffFromTool([sys.executable, '-c',
18 'print("@old_path @new_path")'],
19 None, None, output)
20 self.addCleanup(diff_obj.finish)
21@@ -1458,7 +1459,7 @@
22 basis_tree = tree.basis_tree()
23 basis_tree.lock_read()
24 self.addCleanup(basis_tree.unlock)
25- diff_obj = diff.DiffFromTool(['python', '-c',
26+ diff_obj = diff.DiffFromTool([sys.executable, '-c',
27 'print "@old_path @new_path"'],
28 basis_tree, tree, output)
29 diff_obj._prepare_files('file', 'file', file_id=b'file-id')
30@@ -1494,7 +1495,7 @@
31 self.addCleanup(old_tree.unlock)
32 tree.lock_read()
33 self.addCleanup(tree.unlock)
34- diff_obj = diff.DiffFromTool(['python', '-c',
35+ diff_obj = diff.DiffFromTool([sys.executable, '-c',
36 'print "@old_path @new_path"'],
37 old_tree, tree, output)
38 self.addCleanup(diff_obj.finish)
39
40=== modified file 'breezy/tests/test_mergetools.py'
41--- breezy/tests/test_mergetools.py 2018-06-20 10:28:56 +0000
42+++ breezy/tests/test_mergetools.py 2018-10-28 11:45:03 +0000
43@@ -78,9 +78,6 @@
44 def test_full_path(self):
45 self.assertTrue(mergetools.check_availability(sys.executable))
46
47- def test_exe_on_path(self):
48- self.assertTrue(mergetools.check_availability('python'))
49-
50 def test_nonexistent(self):
51 self.assertFalse(mergetools.check_availability('DOES NOT EXIST'))
52

Subscribers

People subscribed via source and target branches