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: [self.assert(x in y)] #22

Open
spagh-eddie opened this issue Apr 9, 2024 · 0 comments
Open

Bug: [self.assert(x in y)] #22

spagh-eddie opened this issue Apr 9, 2024 · 0 comments

Comments

@spagh-eddie
Copy link

spagh-eddie commented Apr 9, 2024

MRE:

import unittest

class MyTest(unittest.TestCase):
    def test_mre(self):
        """docstring"""
        [self.assertTrue(0 in ())]
$ teyit test.py 
Traceback (most recent call last):
  ...
  File "<unknown>", line 7
    self.assertIn(0, ())
IndentationError: unexpected indent
Failed to refactor file 'test.py'

This is due to the first pass of rewrite_source() turning the line into ' self.assertIn(0, ())\n', indented by 9 spaces. I would instead expect it to output valid python.

teyit/teyit.py

Line 297 in 4ca1d27

source, _refactors = rewrite_source(source, blacklist=blacklist)

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

1 participant