diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index 0fd714b..e1ad68e 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -15,7 +15,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - python-version: [3.5, 3.6, 3.7, 3.8] + python-version: [2.7, 3.5, 3.6, 3.7, 3.8] steps: - uses: actions/checkout@v2 diff --git a/lighttree/interactive.py b/lighttree/interactive.py index 5d489d5..0576251 100644 --- a/lighttree/interactive.py +++ b/lighttree/interactive.py @@ -192,7 +192,7 @@ def __getitem__(self, item): r._expand_attrs(depth=1) return r - def __str__(self): + def _show(self): tree_repr = self._tree.show() if self._root_path is None: return "<%s>\n%s" % ( @@ -205,3 +205,6 @@ def __str__(self): text(current_path), text(tree_repr), ) + + def __str__(self): + return self._show() diff --git a/tests/test_interactive.py b/tests/test_interactive.py index 311e074..133a785 100644 --- a/tests/test_interactive.py +++ b/tests/test_interactive.py @@ -192,7 +192,7 @@ class InteractiveTree(TreeBasedObj): # test representations self.assertEqual( - obj.__str__(), + obj._show(), """ root ├── a @@ -205,7 +205,7 @@ class InteractiveTree(TreeBasedObj): """, ) self.assertEqual( - a.__str__(), + a._show(), """ a ├── a1 @@ -215,7 +215,7 @@ class InteractiveTree(TreeBasedObj): """, ) self.assertEqual( - a.a1.__str__(), + a.a1._show(), """ a1 ├── a11