You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With new pyproject-fmt (0.4.0) test_auto_formatting fails:
________________________________ test_auto_formatting ________________________________
tmp_path = PosixPath('/usr/src/tmp/pytest-of-builder/pytest-2/test_auto_formatting0')
capsys = <_pytest.capture.CaptureFixture object at 0x7ff8d4065180>
@pytest.mark.skipif(
sys.version_info < (3, 7),
reason="pyproject-fmt is only available on Python 3.7+",
)
def test_auto_formatting(tmp_path, capsys):
setupcfg = """
[metadata]
version = 42
name = myproj
"""
normal_output = """
requires = ["setuptools>=61.2"]
"""
expected = """
requires = [
"setuptools>=61.2",
]
"""
# Check if the underlying function works
formatted = cli.apply_auto_formatting(cleandoc(expected))
assert formatted.strip() == cleandoc(expected).strip()
(tmp_path / "setup.cfg").write_text(cleandoc(setupcfg), encoding="utf-8")
assert (tmp_path / "setup.cfg").exists()
# Check the output when formatting in off
cli.run([str(tmp_path / "setup.cfg")])
out, _ = capsys.readouterr()
assert cleandoc(normal_output) in out
assert cleandoc(expected) not in out
# Check the output when formatting in on
breakpoint()
cli.run(["-F", str(tmp_path / "setup.cfg")])
out, _ = capsys.readouterr()
assert cleandoc(normal_output) not in out
> assert cleandoc(expected) in out
E assert 'requires = [\n "setuptools>=61.2",\n]' in ''
E + where 'requires = [\n "setuptools>=61.2",\n]' = cleandoc('\n requires = [\n "setuptools>=61.2",\n ]\n ')
tests/test_cli.py:145: AssertionError
--------------------------------- Captured log call ----------------------------------
WARNING ini2toml:cli.py:101 Auto-formatting failed, falling back to original text
WARNING ini2toml:cli.py:101 Auto-formatting failed, falling back to original text
============================== short test summary info ===============================
FAILED tests/test_cli.py::test_auto_formatting - assert 'requires = [\n "setuptools>=61.2",\n]' in ''
With new
pyproject-fmt
(0.4.0)test_auto_formatting
fails:This is caused by tox-dev/pyproject-fmt@c690ab2 (added
pyproject_toml: Path
field toConfig
).The text was updated successfully, but these errors were encountered: