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
=== modified file 'breezy/tests/test_diff.py'
--- breezy/tests/test_diff.py 2018-07-11 21:06:20 +0000
+++ breezy/tests/test_diff.py 2018-10-28 11:45:03 +0000
@@ -17,6 +17,7 @@
17import os17import os
18import re18import re
19import subprocess19import subprocess
20import sys
20import tempfile21import tempfile
2122
22from .. import (23from .. import (
@@ -1430,7 +1431,7 @@
14301431
1431 def test_execute(self):1432 def test_execute(self):
1432 output = BytesIO()1433 output = BytesIO()
1433 diff_obj = diff.DiffFromTool(['python', '-c',1434 diff_obj = diff.DiffFromTool([sys.executable, '-c',
1434 'print("@old_path @new_path")'],1435 'print("@old_path @new_path")'],
1435 None, None, output)1436 None, None, output)
1436 self.addCleanup(diff_obj.finish)1437 self.addCleanup(diff_obj.finish)
@@ -1458,7 +1459,7 @@
1458 basis_tree = tree.basis_tree()1459 basis_tree = tree.basis_tree()
1459 basis_tree.lock_read()1460 basis_tree.lock_read()
1460 self.addCleanup(basis_tree.unlock)1461 self.addCleanup(basis_tree.unlock)
1461 diff_obj = diff.DiffFromTool(['python', '-c',1462 diff_obj = diff.DiffFromTool([sys.executable, '-c',
1462 'print "@old_path @new_path"'],1463 'print "@old_path @new_path"'],
1463 basis_tree, tree, output)1464 basis_tree, tree, output)
1464 diff_obj._prepare_files('file', 'file', file_id=b'file-id')1465 diff_obj._prepare_files('file', 'file', file_id=b'file-id')
@@ -1494,7 +1495,7 @@
1494 self.addCleanup(old_tree.unlock)1495 self.addCleanup(old_tree.unlock)
1495 tree.lock_read()1496 tree.lock_read()
1496 self.addCleanup(tree.unlock)1497 self.addCleanup(tree.unlock)
1497 diff_obj = diff.DiffFromTool(['python', '-c',1498 diff_obj = diff.DiffFromTool([sys.executable, '-c',
1498 'print "@old_path @new_path"'],1499 'print "@old_path @new_path"'],
1499 old_tree, tree, output)1500 old_tree, tree, output)
1500 self.addCleanup(diff_obj.finish)1501 self.addCleanup(diff_obj.finish)
15011502
=== modified file 'breezy/tests/test_mergetools.py'
--- breezy/tests/test_mergetools.py 2018-06-20 10:28:56 +0000
+++ breezy/tests/test_mergetools.py 2018-10-28 11:45:03 +0000
@@ -78,9 +78,6 @@
78 def test_full_path(self):78 def test_full_path(self):
79 self.assertTrue(mergetools.check_availability(sys.executable))79 self.assertTrue(mergetools.check_availability(sys.executable))
8080
81 def test_exe_on_path(self):
82 self.assertTrue(mergetools.check_availability('python'))
83
84 def test_nonexistent(self):81 def test_nonexistent(self):
85 self.assertFalse(mergetools.check_availability('DOES NOT EXIST'))82 self.assertFalse(mergetools.check_availability('DOES NOT EXIST'))
8683

Subscribers

People subscribed via source and target branches