From ff4e11a16c3e3d9949502eb5c02f0ba1533f61d8 Mon Sep 17 00:00:00 2001 From: Konsta Vesterinen Date: Thu, 20 Feb 2014 13:58:59 +0200 Subject: [PATCH] Fix path tests for py33 --- sqlalchemy_utils/path.py | 4 ++-- tests/test_path.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/sqlalchemy_utils/path.py b/sqlalchemy_utils/path.py index f8224ad..96f274b 100644 --- a/sqlalchemy_utils/path.py +++ b/sqlalchemy_utils/path.py @@ -123,9 +123,9 @@ class AttrPath(object): return len(self.path) def __repr__(self): - return "%s(%r, %r)" % ( + return "%s(%s, %r)" % ( self.__class__.__name__, - self.class_, + self.class_.__name__, self.path.path ) diff --git a/tests/test_path.py b/tests/test_path.py index b4c4a41..bc77e77 100644 --- a/tests/test_path.py +++ b/tests/test_path.py @@ -1,3 +1,4 @@ +import six from pytest import mark import sqlalchemy as sa from sqlalchemy_utils.path import Path, AttrPath @@ -66,8 +67,7 @@ class TestAttrPath(TestCase): def test_repr(self): path = AttrPath(self.SubSection, 'section.document') assert repr(path) == ( - "AttrPath(, " - "'section.document')" + "AttrPath(SubSection, 'section.document')" ) def test_index(self): @@ -148,7 +148,7 @@ class TestPath(object): assert Path('s.s2.s3').index('s2') == 1 def test_unicode(self): - assert unicode(Path('s.s2')) == u's.s2' + assert six.text_type(Path('s.s2')) == u's.s2' def test_getitem_with_slice(self): path = Path('s.s2.s3')