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: TypeError: format_file() takes 1 positional argument but 2 were given #9

Closed
boidolr opened this issue Oct 31, 2023 · 4 comments
Closed

Comments

@boidolr
Copy link

boidolr commented Oct 31, 2023

Using pytest-ruff v0.2:

self = <RuffFormatItem ruff::format>

    def runtest(self):
>       self.handler(self.fspath)
E       TypeError: format_file() takes 1 positional argument but 2 were given

I think the issue is that we get passed self here: https://github.com/businho/pytest-ruff/blob/main/pytest_ruff.py#L98

@skellys
Copy link
Contributor

skellys commented Oct 31, 2023

I had the same issue in #7 and put up a bugfix PR here, but I found one case where behavior isn't intuitive (that one failing test): #8

@iurisilvio
Copy link
Contributor

iurisilvio commented Oct 31, 2023

Fixed by #8. 🙏🏻

I was really interested in integrating ruff format, did a bad release for tat and didn't had time to make it work in my projects. 😞

@skellys
Copy link
Contributor

skellys commented Oct 31, 2023

glad i could help! cheers

@boidolr
Copy link
Author

boidolr commented Nov 1, 2023

Thanks for the quick fix @skellys and @iurisilvio for providing this package :)
Also sorry for duplicating the issue.

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

3 participants