Skip to content

Tests fail for Python 3.x #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
ppope opened this issue Sep 11, 2015 · 0 comments
Open

Tests fail for Python 3.x #1

ppope opened this issue Sep 11, 2015 · 0 comments
Assignees

Comments

@ppope
Copy link
Contributor

ppope commented Sep 11, 2015

Tests work under Python 2.7 as expected. However, with

$ python --version
Python 3.4.3 :: Anaconda 2.2.0 (64-bit)

Running

$ python ./test/test_sorted.py

Obtains (truncated traceback)

ERROR: test_inorder (__main__.SortedTest)
...
  File "./test/test_sorted.py", line 9, in sort
    items[:] = sorted(items)
TypeError: 'range' object does not support item assignment

and

ERROR: test_stability (__main__.SortedTest)
...
    items[:] = sorted(items)
TypeError: unorderable types: IntHolder() < IntHolder()

First error is due to range being a generator object by default in Python 3. See this SO post. Should be a quick fix by changing items = range(1,i,d) to items = list(range(1,i,d)) in sort_tester.py.

I'm not sure about the second just yet.

@ppope ppope self-assigned this Sep 11, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant