Skip to content
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

Bug/fix enummeta comparisons #7

Merged
merged 4 commits into from Nov 14, 2016
Merged

Bug/fix enummeta comparisons #7

merged 4 commits into from Nov 14, 2016

Conversation

ryanmrubin
Copy link
Contributor

@ryanmrubin ryanmrubin commented Nov 14, 2016

EnumMeta comparisons were failing in Python 3 because they relied on __cmp__, which is no longer present (and neither is the builtin cmp().

This adds __lt__, __eq__, and the functools.total_ordering decorator to the EnumMeta class for Python 3 purposes.

cmp is left in for python 2.

GLOB sdist-make: /Users/rrubin/projects/duo/setup.py
py27 inst-nodeps: /Users/rrubin/projects/duo/.tox/dist/duo-0.3.1.zip
py27 installed: boto==2.43.0,coverage==4.2,duo==0.3.1,funcsigs==1.0.2,mock==2.0.0,nose==1.3.7,pbr==1.10.0,six==1.10.0
py27 runtests: PYTHONHASHSEED='1470742131'
py27 runtests: commands[0] | nosetests --with-coverage --cover-package=duo
............
Name     Stmts   Miss  Cover
----------------------------
duo.py     338    104    69%
----------------------------------------------------------------------
Ran 12 tests in 0.141s

OK
py35 inst-nodeps: /Users/rrubin/projects/duo/.tox/dist/duo-0.3.1.zip
py35 installed: boto==2.43.0,coverage==4.2,duo==0.3.1,mock==2.0.0,nose==1.3.7,pbr==1.10.0,six==1.10.0
py35 runtests: PYTHONHASHSEED='1470742131'
py35 runtests: commands[0] | nosetests --with-coverage --cover-package=duo
............
Name     Stmts   Miss  Cover
----------------------------
duo.py     338    102    70%
----------------------------------------------------------------------
Ran 12 tests in 0.175s

OK
______________________________________________________________________ summary _______________________________________________________________________
  py27: commands succeeded
  py35: commands succeeded
  congratulations :)

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.6%) to 60.234% when pulling aa5f29b on ryanmrubin:bug/fix-enummeta-comparisons into 4d8305a on eykd:master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage decreased (-0.6%) to 60.234% when pulling aa5f29b on ryanmrubin:bug/fix-enummeta-comparisons into 4d8305a on eykd:master.

cmp() still works with the total_ordering methods instead of __cmp__
@coveralls
Copy link

coveralls commented Nov 14, 2016

Coverage Status

Coverage decreased (-0.2%) to 60.651% when pulling 6a8f3df on ryanmrubin:bug/fix-enummeta-comparisons into 4d8305a on eykd:master.

@coveralls
Copy link

coveralls commented Nov 14, 2016

Coverage Status

Coverage increased (+1.4%) to 62.281% when pulling fedd738 on ryanmrubin:bug/fix-enummeta-comparisons into 4d8305a on eykd:master.

@eykd
Copy link
Owner

eykd commented Nov 14, 2016

👍

@eykd eykd merged commit b108804 into eykd:master Nov 14, 2016
@ryanmrubin ryanmrubin deleted the bug/fix-enummeta-comparisons branch November 14, 2016 19:31
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

Successfully merging this pull request may close these issues.

None yet

3 participants