Skip to content

Commit eeb8205

Browse files
committed
Fix path relative to SPARK_HOME in tests
1 parent 1eaa08b commit eeb8205

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

python/pyspark/tests.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,8 @@ def test_oldhadoop(self):
275275
ei = [(1, u'aa'), (1, u'aa'), (2, u'aa'), (2, u'bb'), (2, u'bb'), (3, u'cc')]
276276
self.assertEqual(ints, ei)
277277

278-
hello = self.sc.hadoopFile("python/test_support/hello.txt",
278+
hellopath = os.path.join(SPARK_HOME, "python/test_support/hello.txt")
279+
hello = self.sc.hadoopFile(hellopath,
279280
"org.apache.hadoop.mapred.TextInputFormat",
280281
"org.apache.hadoop.io.LongWritable",
281282
"org.apache.hadoop.io.Text").collect()
@@ -292,7 +293,8 @@ def test_newhadoop(self):
292293
ei = [(1, u'aa'), (1, u'aa'), (2, u'aa'), (2, u'bb'), (2, u'bb'), (3, u'cc')]
293294
self.assertEqual(ints, ei)
294295

295-
hello = self.sc.newAPIHadoopFile("python/test_support/hello.txt",
296+
hellopath = os.path.join(SPARK_HOME, "python/test_support/hello.txt")
297+
hello = self.sc.newAPIHadoopFile(hellopath,
296298
"org.apache.hadoop.mapreduce.lib.input.TextInputFormat",
297299
"org.apache.hadoop.io.LongWritable",
298300
"org.apache.hadoop.io.Text").collect()

0 commit comments

Comments
 (0)