From dcbc93a117b0efaa0e42fa6359eed4a71a9ca341 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Fri, 10 Jun 2022 02:04:30 +0300 Subject: tests: Convert to formatted string literals Use formatted string literals to replace legacy printf-style string formatting. Signed-off-by: Laurent Pinchart Reviewed-by: Kieran Bingham --- tests/kms-test-planeposition.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'tests/kms-test-planeposition.py') diff --git a/tests/kms-test-planeposition.py b/tests/kms-test-planeposition.py index e843ae1..aceb849 100755 --- a/tests/kms-test-planeposition.py +++ b/tests/kms-test-planeposition.py @@ -42,8 +42,8 @@ class PlanePositionTest(kmstest.KMSTest): self.skip('no CRTC available with connector and at least two planes') return - self.logger.log('Testing connector %s, CRTC %u, mode %s with %u planes' % \ - (connector.fullname, crtc.id, mode.name, len(planes))) + self.logger.log(f'Testing connector {connector.fullname}, CRTC {crtc.id}, ' + f'mode {mode.name} with {len(planes)} planes') # Create a frame buffer fb = pykms.DumbFramebuffer(self.card, mode.hdisplay, mode.vdisplay, 'XR24') @@ -52,7 +52,7 @@ class PlanePositionTest(kmstest.KMSTest): # Set the mode with no plane, wait 5s for the monitor to wake up ret = self.atomic_crtc_mode_set(crtc, connector, mode, sync=True) if ret < 0: - self.fail('atomic mode set failed with %d' % ret) + self.fail(f'atomic mode set failed with {ret}') return self.logger.log('Initial atomic mode set completed') @@ -63,7 +63,7 @@ class PlanePositionTest(kmstest.KMSTest): destination = kmstest.Rect(0, 0, fb.width // 2, fb.height) ret = self.atomic_plane_set(planes[0], crtc, source, destination, fb, sync=True) if ret < 0: - self.fail('atomic plane set for first plane failed with %d' % ret) + self.fail(f'atomic plane set for first plane failed with {ret}') return self.logger.log('Root plane enabled') @@ -79,10 +79,10 @@ class PlanePositionTest(kmstest.KMSTest): ret = self.atomic_plane_set(planes[1], crtc, source, destination, fb, sync=True) if ret < 0: - self.fail('atomic plane set with offset %d,%d' % offset) + self.fail(f'atomic plane set with offset {offset}') return - self.logger.log('Moved overlay plane to %d,%d' % offset) + self.logger.log(f'Moved overlay plane to {offset}') time.sleep(3) # Try to move the plane completely off-screen. The device is expected @@ -97,10 +97,10 @@ class PlanePositionTest(kmstest.KMSTest): ret = self.atomic_plane_set(planes[1], crtc, source, destination, fb, sync=True) if ret < 0: - self.fail('atomic plane set with offset %d,%d' % offset) + self.fail(f'atomic plane set with offset {offset}') return - self.logger.log('Moved overlay plane to %d,%d' % offset) + self.logger.log(f'Moved overlay plane to {offset}') time.sleep(3) # Disable and re-enable the plane when it is off-screen. The device is -- cgit v1.2.3