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: TestClient no longer accepts json as a delete argument #2087

Closed
LorhanSohaky opened this issue Mar 20, 2023 · 11 comments
Closed

bug: TestClient no longer accepts json as a delete argument #2087

LorhanSohaky opened this issue Mar 20, 2023 · 11 comments

Comments

@LorhanSohaky
Copy link

When they migrated from requests to httpx they forgot to add the json parameter.

TypeError: delete() got an unexpected keyword argument 'json'

image

https://github.com/encode/starlette/pull/1376/files

@euri10
Copy link
Member

euri10 commented Mar 20, 2023

hello, a quick search : encode/httpx#1587

@euri10 euri10 closed this as completed Mar 20, 2023
@Kludex
Copy link
Sponsor Member

Kludex commented Mar 20, 2023

You can also use https://github.com/Kludex/bump-testclient for the migration, if you want. 👀

@LorhanSohaky
Copy link
Author

hello, a quick search : encode/httpx#1587

Sorry, I was looking for open discussions. But then shouldn't this migration be classified as breaking change and not just change?

@Kludex
Copy link
Sponsor Member

Kludex commented Mar 20, 2023

Since we are on zero version (0.x), any breaking or important change alters the minor (0.y.z -> 0.(y + 1).0). Which is what we did.

@LorhanSohaky
Copy link
Author

I refer to the changelog
https://github.com/encode/starlette/releases/tag/0.21.0

@Kludex
Copy link
Sponsor Member

Kludex commented Mar 20, 2023

[...] your test suite will likely break. [...]

What were you expecting there?

@LorhanSohaky
Copy link
Author

I'm just commenting because when I updated the fastapi version the tests broke, so I saw that they had updated the starlette version. So I searched the changelogs for breaking change or something similar, but I couldn't find it.

So I kept looking using "git diff" to find out what version it happened on

BREAKING CHANGE

@LorhanSohaky
Copy link
Author

I could be wrong, but they usually put breaking changes like this

@Kludex
Copy link
Sponsor Member

Kludex commented Mar 20, 2023

Who are "they"?

@LorhanSohaky
Copy link
Author

Who are "they"?

"they" = other libraries

@mehmetcanfarsak
Copy link

Hi,
I wrote an article about possible solutions and how to implement it
https://medium.com/@mehmetcanfarsak/solution-for-testclient-delete-payload-support-8ae12e153a3a

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

4 participants