Skip to content

Conversation

michaelbukachi
Copy link
Contributor

This PR handles issue #47

@michaelbukachi
Copy link
Contributor Author

@jstasiak Tests are failing due to the werkzeug upgrade to 1.0.0 which affects Flask.

@jstasiak
Copy link
Collaborator

Hmm, ok, I'll take care of it in a bit. In the meantime do you want to mention Flask-RESTX in the readme? Flask-RestPlus and Flask-Restful are there, so maybe it'd be good to have this as well.

@michaelbukachi
Copy link
Contributor Author

Alright.

@michaelbukachi
Copy link
Contributor Author

@jstasiak For the werkzeug you might have to lock the version to < 1.0.0

import flask_restx as flask_restplus
from flask_restx.utils import unpack as flask_response_unpack # noqa
except ImportError:
flask_restplus = None
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, so I suspected that the name flask_restplus can't be reused here because of this block https://github.com/alecthomas/flask_injector/blob/master/flask_injector/__init__.py#L116 but the tests were actually passing. :>

Turns out that block could actually be removed (I didn't, it's needed) because it wasn't actually being tested. I added a test in 717a12b so, if you rerun your tests now, you'll find they'll fail and need to be modified.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rerun after rebasing on current master, that is.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay. On it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The restplus and restx tests are now failing appropriately. Are you working on this fix?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, I expect they'll be failing because of your patch now, so... :)

What are the failures?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nevermind. Got it working.

@@ -329,6 +330,29 @@ def get(self):
eq_(data, {'int': 0})


def test_flask_restx_integration_works():
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please modify this test following 717a12b

@michaelbukachi
Copy link
Contributor Author

@jstasiak I've resolved the issue.

@michaelbukachi
Copy link
Contributor Author

@jstasiak It seems adding the try..except block for flask-restx causes a decrease in coverage.

@jstasiak
Copy link
Collaborator

That's fine, it's just a number.

@jstasiak
Copy link
Collaborator

Nice job!

@jstasiak jstasiak merged commit 44bb4c2 into python-injector:master Feb 12, 2020
@jstasiak
Copy link
Collaborator

This has just been released in version 0.12.2.

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.

2 participants