From fd404e2b89cf305b853a79fc338aa295cf76f271 Mon Sep 17 00:00:00 2001 From: Alexander Hess Date: Sun, 31 Jan 2021 19:34:05 +0100 Subject: [PATCH] Adjust `Pixel.__repr__()` a tiny bit --- src/urban_meal_delivery/db/pixels.py | 4 ++-- tests/db/test_pixels.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/urban_meal_delivery/db/pixels.py b/src/urban_meal_delivery/db/pixels.py index 5876f19..9461d4d 100644 --- a/src/urban_meal_delivery/db/pixels.py +++ b/src/urban_meal_delivery/db/pixels.py @@ -52,7 +52,7 @@ class Pixel(meta.Base): def __repr__(self) -> str: """Non-literal text representation.""" - return '<{cls}: ({x}, {y})>'.format( + return '<{cls}: ({x}|{y})>'.format( cls=self.__class__.__name__, x=self.n_x, y=self.n_y, ) @@ -159,7 +159,7 @@ class Pixel(meta.Base): (self.southwest.latitude, self.southwest.longitude), (self.northeast.latitude, self.northeast.longitude), ) - info_text = f'Pixel({self.n_x}, {self.n_y})' + info_text = f'Pixel({self.n_x}|{self.n_y})' # Make the `Pixel`s look like a checkerboard. if (self.n_x + self.n_y) % 2: diff --git a/tests/db/test_pixels.py b/tests/db/test_pixels.py index ed7bbec..317ce56 100644 --- a/tests/db/test_pixels.py +++ b/tests/db/test_pixels.py @@ -18,7 +18,7 @@ class TestSpecialMethods: """`Pixel` has a non-literal text representation.""" result = repr(pixel) - assert result == f'' + assert result == f'' @pytest.mark.db