elpy
elpy copied to clipboard
BLACKTestCase.test_should_read_options_from_pyproject_toml failing in 758c1ab
With Python 3.10, Emacs 27.1, and Black 21.12b0 and Elpy 758c1ab
=================================== FAILURES ===================================
__________ BLACKTestCase.test_should_read_options_from_pyproject_toml __________
self = <elpy.tests.test_black.BLACKTestCase testMethod=test_should_read_options_from_pyproject_toml>
def test_should_read_options_from_pyproject_toml(self):
with open('pyproject.toml', 'w') as f:
f.write('[tool.black]\nline-length = 10')
self.addCleanup(os.remove, 'pyproject.toml')
testdata = [('x= 123\n', 'x = 123\n'),
('x=1; \ny=2 \n', 'x = 1\ny = 2\n'),
('x, y, z, a, b, c = 123, 124, 125, 126, 127, 128',
'(\n x,\n y,\n z,\n a,\n b,\n c,\n)'
' = (\n 123,\n 124,\n 125,'
'\n 126,\n 127,\n 128,\n)\n')]
for src, expected in testdata:
> self._assert_format(src, expected)
elpy/tests/test_black.py:64:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
elpy/tests/test_black.py:49: in _assert_format
self.assertEqual(new_block, expected)
E AssertionError: 'x, y, z, a, b, c = 123, 124, 125, 126, 127, 128\n' != '(\n x,\n y,\n z,\n a,\n b,[76 chars]n)\n'
E - x, y, z, a, b, c = 123, 124, 125, 126, 127, 128
E + (
E + x,
E + y,
E + z,
E + a,
E + b,
E + c,
E + ) = (
E + 123,
E + 124,
E + 125,
E + 126,
E + 127,
E + 128,
E + )
=============================== warnings summary ===============================
../../../../../../usr/lib/python3/dist-packages/yapf/yapflib/errors.py:16
/usr/lib/python3/dist-packages/yapf/yapflib/errors.py:16: PendingDeprecationWarning: lib2to3 package is deprecated and may not be able to parse Python 3.10+
from lib2to3.pgen2 import tokenize
-- Docs: https://docs.pytest.org/en/stable/warnings.html
=========================== short test summary info ============================
FAILED elpy/tests/test_black.py::BLACKTestCase::test_should_read_options_from_pyproject_toml
Oh, and this is a regression relative to 4248dcce