yohanboniface / falcon-oauth

Oauth wrapper around https://github.com/idan/oauthlib/ for Falcon.
19 stars 9 forks source link

added tox to run tests #5

Open JonathanHuot opened 5 years ago

JonathanHuot commented 5 years ago

Hi, I don't know if this project is still used, or if any users are interested, but I give it a try to see if tests were working as expected. As I didn't found any automatic building tools, I am proposing tox. It seems pytest was used to run tests, but, not sure of the syntax here.

Both python27 and python36 are failing at the moment.

tox -e py27:

E   ConftestImportFailure: (local('/Users/doomsday/eds/oauthlib/falcon-oauth/tests/provider/oauth2/conftest.py'), (<type 'exceptions.ImportError'>, ImportError('cannot import name timezone',), <traceback object at 0x105ba9440>))

tox -e py36:

  def test_simple_get(client):
        fixture 'client' not found
        available fixtures: pytestconfig, capfd, capsys, tmpdir, tmpdir_factory, monkeypatch, recwarn, record_xml_property, cache, app, clientmodel, token, user
        use 'py.test --fixtures [testpath]' for help on them.

@yohanboniface , Dunno if you are still working on this or if you have any time :-)

yohanboniface commented 5 years ago
    fixture 'client' not found

I'd say pip install pytest-falcon should fix that?

JonathanHuot commented 5 years ago

Thanks! It fixed the py36 build :-)

Any clues for the py27 ? or you want to drop this python version support ? Would not be worth the effort to preserve this version, IMHO.

yohanboniface commented 5 years ago

Any clues for the py27 ? or you want to drop this python version support ? Would not be worth the effort to preserve this version, IMHO.

Ages since I ran a python 2 thing. Let's say the effort will worth it if/when someone need it.

About tox: what's its added value in respect to running pytest directly?

yohanboniface commented 5 years ago

Note: I'm not using this project anymore myself, mainly because I'm not using Falcon these days (we migrated little by little our project to this small async lib we maintain: https://github.com/pyrates/roll).

JonathanHuot commented 5 years ago

I removed the python2.6 support, it makes sense.

The benefit of using tox is the ability to create virtualenv and running test commands all-in-one. pytest best practices also recommend it https://docs.pytest.org/en/latest/goodpractices.html#tox

Multiples advantages of using it instead of using pytest directly:

JonathanHuot commented 5 years ago

Hi @yohanboniface, do you see any issues by merging this ?