PyCQA / autoflake

Removes unused imports and unused variables as reported by pyflakes

Home Page:https://pypi.org/project/autoflake/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

test_is_literal_or_name fails with Python 3.10

mcepl opened this issue · comments

While packaging autoflake for openSUSE I have test_is_literal_or_name failing with 3.10 (3.8 and 3.9 passes complete test suite):

[    9s] + pytest-3.10 --ignore=_build.python39 --ignore=_build.python310 --ignore=_build.python38 -v
[   10s] ============================= test session starts ==============================
[   10s] platform linux -- Python 3.10.2, pytest-6.2.5, py-1.11.0, pluggy-1.0.0 -- /usr/bin/python3.10
...
[   11s] =================================== FAILURES ===================================
[   11s] ______________________ UnitTests.test_is_literal_or_name _______________________
[   11s]
[   11s] self = <test_autoflake.UnitTests testMethod=test_is_literal_or_name>
[   11s]
[   11s]     def test_is_literal_or_name(self):
[   11s]         self.assertTrue(autoflake.is_literal_or_name('123'))
[   11s]         self.assertTrue(autoflake.is_literal_or_name('[1, 2, 3]'))
[   11s]         self.assertTrue(autoflake.is_literal_or_name('xyz'))
[   11s]
[   11s]         self.assertFalse(autoflake.is_literal_or_name('xyz.prop'))
[   11s]         self.assertFalse(autoflake.is_literal_or_name(' '))
[   11s] >       self.assertFalse(autoflake.is_literal_or_name(' 1'))
[   11s] E       AssertionError: True is not false
[   11s]
[   11s] test_autoflake.py:1203: AssertionError

Complete build log with all packages used and tests run.

This is fixed now.

This is fixed now.

In which commit? What patch I should add to our build to make the test pass? Is it just e9e0825 ?

This is fixed now.

In which commit? What patch I should add to our build to make the test pass? Is it just e9e0825 ?

Yes.

I'm trying to figure out the process to push new releases to PyPI (I don't have permissions), but in the mean time you can grab that commit.