@@ -49,7 +49,7 @@ def __init__(self, expected_msg_nums, done_event):
4949 def pubsub_callback (self , message ):
5050 # every time a pubsub message comes in, print it and count it
5151 self .msg_count += 1
52- print ('Message {}: {}' . format ( self .msg_count , message .data ) )
52+ print (f 'Message { self .msg_count } : { message .data } ' )
5353 message .ack ()
5454 if (self .msg_count == self .expected_msg_nums ):
5555 self .done_event .set ()
@@ -58,13 +58,13 @@ def pubsub_callback(self, message):
5858class TestContainerAnalysisSamples :
5959
6060 def setup_method (self , test_method ):
61- print ('SETUP {}' . format ( test_method .__name__ ) )
62- self .note_id = 'note-{}' . format ( uuid .uuid4 ())
63- self .image_url = '{}.{}' . format ( uuid .uuid4 (), test_method .__name__ )
61+ print (f 'SETUP { test_method .__name__ } ' )
62+ self .note_id = f 'note-{ uuid .uuid4 ()} '
63+ self .image_url = f' { uuid .uuid4 ()} . { test_method .__name__ } '
6464 self .note_obj = samples .create_note (self .note_id , PROJECT_ID )
6565
6666 def teardown_method (self , test_method ):
67- print ('TEAR DOWN {}' . format ( test_method .__name__ ) )
67+ print (f 'TEAR DOWN { test_method .__name__ } ' )
6868 try :
6969 samples .delete_note (self .note_id , PROJECT_ID )
7070 except NotFound :
@@ -158,7 +158,7 @@ def test_pubsub(self):
158158 except AlreadyExists :
159159 pass
160160
161- subscription_id = 'container-analysis-test-{}' . format ( uuid .uuid4 ())
161+ subscription_id = f 'container-analysis-test-{ uuid .uuid4 ()} '
162162 subscription_name = client .subscription_path (PROJECT_ID ,
163163 subscription_id )
164164 samples .create_occurrence_subscription (subscription_id , PROJECT_ID )
@@ -181,7 +181,7 @@ def test_pubsub(self):
181181 # to 180 seconds.
182182 # See also: python-docs-samples/issues/2894
183183 job_done .wait (timeout = 180 )
184- print ('done. msg_count = {}' . format ( receiver .msg_count ) )
184+ print (f 'done. msg_count = { receiver .msg_count } ' )
185185 assert message_count <= receiver .msg_count
186186 finally :
187187 # clean up
@@ -200,7 +200,7 @@ def test_poll_discovery_occurrence_fails(self):
200200 @pytest .mark .flaky (max_runs = 3 , min_passes = 1 )
201201 def test_poll_discovery_occurrence (self ):
202202 # create discovery occurrence
203- note_id = 'discovery-note-{}' . format ( uuid .uuid4 ())
203+ note_id = f 'discovery-note-{ uuid .uuid4 ()} '
204204 client = containeranalysis_v1 .ContainerAnalysisClient ()
205205 grafeas_client = client .get_grafeas_client ()
206206 note = {
@@ -258,7 +258,7 @@ def test_find_high_severity_vulnerabilities(self):
258258 assert len (occ_list ) == 0
259259
260260 # create new high severity vulnerability
261- note_id = 'discovery-note-{}' . format ( uuid .uuid4 ())
261+ note_id = f 'discovery-note-{ uuid .uuid4 ()} '
262262 client = containeranalysis_v1 .ContainerAnalysisClient ()
263263 grafeas_client = client .get_grafeas_client ()
264264 note = {
0 commit comments