Skip to content

Commit d7062de

Browse files
Issue #26918: Skipped some tests in test_pipes on Android.
Patch by Xavier de Gaye.
1 parent fb81d3c commit d7062de

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

Lib/test/test_pipes.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import os
33
import string
44
import unittest
5+
import shutil
56
from test.support import TESTFN, run_unittest, unlink, reap_children
67

78
if os.name != 'posix':
@@ -18,6 +19,8 @@ def tearDown(self):
1819
unlink(f)
1920

2021
def testSimplePipe1(self):
22+
if shutil.which('tr') is None:
23+
self.skipTest('tr is not available')
2124
t = pipes.Template()
2225
t.append(s_command, pipes.STDIN_STDOUT)
2326
f = t.open(TESTFN, 'w')
@@ -27,6 +30,8 @@ def testSimplePipe1(self):
2730
self.assertEqual(f.read(), 'HELLO WORLD #1')
2831

2932
def testSimplePipe2(self):
33+
if shutil.which('tr') is None:
34+
self.skipTest('tr is not available')
3035
with open(TESTFN, 'w') as f:
3136
f.write('hello world #2')
3237
t = pipes.Template()
@@ -36,6 +41,8 @@ def testSimplePipe2(self):
3641
self.assertEqual(f.read(), 'HELLO WORLD #2')
3742

3843
def testSimplePipe3(self):
44+
if shutil.which('tr') is None:
45+
self.skipTest('tr is not available')
3946
with open(TESTFN, 'w') as f:
4047
f.write('hello world #2')
4148
t = pipes.Template()

0 commit comments

Comments
 (0)