Skip to content

Commit 0d1563e

Browse files
committed
test fixes
1 parent 9c3500c commit 0d1563e

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

sdks/python/apache_beam/io/hadoopfilesystem_test.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,11 @@
3232
from apache_beam.options.pipeline_options import HadoopFileSystemOptions
3333
from apache_beam.options.pipeline_options import PipelineOptions
3434

35+
try:
36+
import hdfs as actual_hdfs
37+
except ImportError:
38+
actual_hdfs = None
39+
3540

3641
class FakeFile(io.BytesIO):
3742
"""File object for FakeHdfs"""
@@ -201,6 +206,7 @@ def checksum(self, path):
201206

202207

203208
@parameterized_class(('full_urls', ), [(False, ), (True, )])
209+
@unittest.skipIf(actual_hdfs is None, "hdfs extra not installed")
204210
class HadoopFileSystemTest(unittest.TestCase):
205211
def setUp(self):
206212
self._fake_hdfs = FakeHdfs()
@@ -607,6 +613,7 @@ def test_delete_error(self):
607613
self.assertFalse(self.fs.exists(url2))
608614

609615

616+
@unittest.skipIf(actual_hdfs is None, "hdfs extra not installed")
610617
class HadoopFileSystemRuntimeValueProviderTest(unittest.TestCase):
611618
"""Tests pipeline_options, in the form of a
612619
RuntimeValueProvider.runtime_options object."""

sdks/python/tox.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ deps =
228228
holdup==1.8.0
229229
extras =
230230
gcp
231+
hdfs
231232
allowlist_externals =
232233
bash
233234
echo

0 commit comments

Comments
 (0)