-
Notifications
You must be signed in to change notification settings - Fork 301
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
BetterJSONEncoder in tests is not simplejson #583
Comments
Thanks for reporting this! I'd rather inherit the |
I'll shortly do a pull request ☺ |
It may be worth checking whether there are any other places in the code where we import from |
I did check that ☺. |
Oh, but now I see - in the tests, we could also use the JSONEncoder already imported by flask.json instead of doing the check for simplejson on our own, right? |
OK, simply using flask.json.JSONEncoder for feriving BetterJSONEncoder indeed does the trick. Note that I mixed in another fix, because the .helpers module uses sys without importing it. EDIT: The last sentence was never spoken. Really. I should not be fixing code after too many hours of work ;)! |
The test suites fail because the JSONEncoder that is extended to BetterJSONEncoder in tests/helpers.py is not from simplejson, whereas the JSONEncoder used by Flask is.
Changing "from json import JSONEncoder to" "from simplejson import JSONEncoder" (and probably explicitly depending on simplejson) solves the issue.
The text was updated successfully, but these errors were encountered: