diff --git a/camelot/core.py b/camelot/core.py index 0a1898c..d6eb3d7 100644 --- a/camelot/core.py +++ b/camelot/core.py @@ -71,7 +71,7 @@ class Cell(object): def __repr__(self): return ''.format( - self.x1, self.y1, self.x2, self.y2) + round(self.x1, 2), round(self.y1, 2), round(self.x2, 2), round(self.y2, 2)) @property def text(self): diff --git a/tests/test_common.py b/tests/test_common.py index 7039657..e872fb8 100644 --- a/tests/test_common.py +++ b/tests/test_common.py @@ -138,3 +138,11 @@ def test_lattice_shift_text(): tables = camelot.read_pdf(filename, line_size_scaling=40, shift_text=['r', 'b']) assert df_rb.equals(tables[0].df) + + +def test_repr(): + filename = os.path.join(testdir, "foo.pdf") + tables = camelot.read_pdf(filename) + assert repr(tables) == "" + assert repr(tables[0]) == "" + assert repr(tables[0].cells[0][0]) == ""