beam-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From al...@apache.org
Subject [beam] branch master updated: Readability/Lint fixes
Date Tue, 07 Jan 2020 20:51:06 GMT
This is an automated email from the ASF dual-hosted git repository.

altay pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/beam.git


The following commit(s) were added to refs/heads/master by this push:
     new 80faf6c  Readability/Lint fixes
     new 11784ee  Merge pull request #10522 from aaltay/awslint
80faf6c is described below

commit 80faf6cac13c8b9dd543944c92c86f3814037d67
Author: Ahmet Altay <altay@google.com>
AuthorDate: Tue Jan 7 11:23:01 2020 -0800

    Readability/Lint fixes
---
 .../apache_beam/io/aws/clients/s3/client_test.py     | 20 ++++++++++----------
 sdks/python/apache_beam/io/aws/s3filesystem_test.py  |  4 ++--
 .../runners/interactive/pipeline_instrument_test.py  |  2 +-
 3 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/sdks/python/apache_beam/io/aws/clients/s3/client_test.py b/sdks/python/apache_beam/io/aws/clients/s3/client_test.py
index e78c484..2457234 100644
--- a/sdks/python/apache_beam/io/aws/clients/s3/client_test.py
+++ b/sdks/python/apache_beam/io/aws/clients/s3/client_test.py
@@ -68,8 +68,8 @@ class ClientErrorTest(unittest.TestCase):
     # Test nonexistent object
     object = self.test_path + 'nonexistent_file_doesnt_exist'
     request = messages.GetRequest(self.test_bucket, object)
-    self.assertRaises(messages.S3ClientError, 
-                      self.client.get_range, 
+    self.assertRaises(messages.S3ClientError,
+                      self.client.get_range,
                       request, 0, 10)
 
     try:
@@ -128,9 +128,9 @@ class ClientErrorTest(unittest.TestCase):
     src_key = self.test_path + 'not_a_real_file_does_not_exist'
     dest_key = self.test_path + 'destination_file_location'
 
-    request = messages.CopyRequest(self.test_bucket, 
-                                   src_key, 
-                                   self.test_bucket, 
+    request = messages.CopyRequest(self.test_bucket,
+                                   src_key,
+                                   self.test_bucket,
                                    dest_key)
 
     with self.assertRaises(messages.S3ClientError) as e:
@@ -150,14 +150,14 @@ class ClientErrorTest(unittest.TestCase):
     upload_id = response.upload_id
 
     part_number = 0.5
-    request = messages.UploadPartRequest(self.test_bucket, 
-                                         object, 
-                                         upload_id, 
-                                         part_number, 
+    request = messages.UploadPartRequest(self.test_bucket,
+                                         object,
+                                         upload_id,
+                                         part_number,
                                          contents)
 
     self.assertRaises(messages.S3ClientError,
-                      self.client.upload_part, 
+                      self.client.upload_part,
                       request)
 
     try:
diff --git a/sdks/python/apache_beam/io/aws/s3filesystem_test.py b/sdks/python/apache_beam/io/aws/s3filesystem_test.py
index 4bddbf2..48b70d6 100644
--- a/sdks/python/apache_beam/io/aws/s3filesystem_test.py
+++ b/sdks/python/apache_beam/io/aws/s3filesystem_test.py
@@ -129,7 +129,7 @@ class S3FileSystemTest(unittest.TestCase):
     with self.assertRaises(BeamIOError) as error:
       self.fs.match(['s3://bucket/'])
 
-    self.assertTrue('Match operation failed' in str(error.exception))
+    self.assertIn('Match operation failed', str(error.exception))
     s3io_mock.list_prefix.assert_called_once_with('s3://bucket/')
 
   @mock.patch('apache_beam.io.aws.s3filesystem.s3io')
@@ -241,7 +241,7 @@ class S3FileSystemTest(unittest.TestCase):
     # Issue batch delete.
     with self.assertRaises(BeamIOError) as error:
       self.fs.delete(files)
-    self.assertTrue('Delete operation failed' in str(error.exception))
+    self.assertIn('Delete operation failed', str(error.exception))
     self.assertEqual(error.exception.exception_details, expected_results)
     s3io_mock.delete_paths.assert_called()
 
diff --git a/sdks/python/apache_beam/runners/interactive/pipeline_instrument_test.py b/sdks/python/apache_beam/runners/interactive/pipeline_instrument_test.py
index f06c271..62cbd73 100644
--- a/sdks/python/apache_beam/runners/interactive/pipeline_instrument_test.py
+++ b/sdks/python/apache_beam/runners/interactive/pipeline_instrument_test.py
@@ -288,7 +288,7 @@ class PipelineInstrumentTest(unittest.TestCase):
     ib.watch({'irrelevant_user_pipeline': irrelevant_user_pipeline})
     # Build instrument from the runner pipeline.
     pipeline_instrument = instr.pin(runner_pipeline)
-    self.assertTrue(pipeline_instrument.user_pipeline is user_pipeline)
+    self.assertIs(pipeline_instrument.user_pipeline, user_pipeline)
 
 
 if __name__ == '__main__':


Mime
View raw message