Skip to content

Commit

Permalink
importers/csvbase: Adjust tests to Python 3.13
Browse files Browse the repository at this point in the history
  • Loading branch information
dnicolodi committed Nov 3, 2024
1 parent 8d6e0f2 commit 8ff8ca9
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions beangulp/importers/csvbase_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ class TestCSVReader(unittest.TestCase):
def test_named_columns(self, filename):
"""\
First, Second
1, 2
3, 4
1, 2
3, 4
"""
class Reader(CSVReader):
first = Column('First')
Expand All @@ -130,7 +130,8 @@ class Reader(CSVReader):
rows = list(reader.read(filename))
self.assertEqual(len(rows), 2)
# tuple elements
self.assertEqual(rows[0][0], ' 1')
self.assertEqual(rows[0][0], '1')
# leading space is preserved
self.assertEqual(rows[1][1], ' 4')
# attribute accessors
self.assertEqual(rows[0].first, '1')
Expand All @@ -152,8 +153,8 @@ class Reader(CSVReader):
def test_indexed_columns_names_false(self, filename):
"""\
First, Second
1, 2
3, 4
1, 2
3, 4
"""
class Reader(CSVReader):
first = Column(0)
Expand All @@ -164,6 +165,7 @@ class Reader(CSVReader):
self.assertEqual(len(rows), 3)
# tuple elements
self.assertEqual(rows[0][0], 'First')
# leading space is preserved
self.assertEqual(rows[2][1], ' 4')
# attribute accessors
self.assertEqual(rows[0].first, 'First')
Expand All @@ -173,8 +175,8 @@ class Reader(CSVReader):
def test_indexed_columns_names_true(self, filename):
"""\
First, Second
1, 2
3, 4
1, 2
3, 4
"""
class Reader(CSVReader):
first = Column(0)
Expand All @@ -183,7 +185,8 @@ class Reader(CSVReader):
rows = list(reader.read(filename))
self.assertEqual(len(rows), 2)
# tuple elements
self.assertEqual(rows[0][0], ' 1')
self.assertEqual(rows[0][0], '1')
# leading space is preserved
self.assertEqual(rows[1][1], ' 4')
# attribute accessors
self.assertEqual(rows[0].first, '1')
Expand Down

0 comments on commit 8ff8ca9

Please sign in to comment.