abravalheri / ini2toml

Automatically conversion of `.ini/.cfg` files to TOML equivalents
https://ini2toml.readthedocs.io/en/latest
Mozilla Public License 2.0
59 stars 9 forks source link

self-tests fail against tomlkit 0.11.6 #59

Closed stanislavlevin closed 2 years ago

stanislavlevin commented 2 years ago

With recent tomlkit 0.11.6 ini2toml tests fail:

...
__________________________________ test_data_files ___________________________________

translator = <ini2toml.translator.Translator object at 0x7fcdedea8e80>

    def test_data_files(translator):
        # Same thing but with the higher level API:
        with pytest.warns(DeprecationWarning, match="'data-files' is deprecated"):
            text = translator.translate(example_data_files, profile_name="setup.cfg")
>           assert text.strip() == expected_data_files.strip()
E           assert '[build-system]\nrequires = ["setuptools>=61.2"]\nbuild-backend = "setuptools.build_meta"\n\n[project]\ndynamic = ["version"]\n\n[tool.setuptools]\ndata-files = {a = ["b"]}\ninclude-package-data = false' == '[build-system]\nrequires = ["setuptools>=61.2"]\nbuild-backend = "setuptools.build_meta"\n\n[project]\ndynamic = ["version"]\n\n[tool]\n[tool.setuptools]\ndata-files = {a = ["b"]}\ninclude-package-data = false'
E               [build-system]
E               requires = ["setuptools>=61.2"]
E               build-backend = "setuptools.build_meta"
E               
E               [project]
E               dynamic = ["version"]
E               
E             - [tool]
E               [tool.setuptools]
E               data-files = {a = ["b"]}
E               include-package-data = false

tests/plugins/test_setuptools_pep621.py:659: AssertionError
...
============================== short test summary info ===============================
FAILED tests/drivers/test_full_toml.py::test_convert - assert '[section1]\n# comment\nvalue = 42 # int value\n\n[section2]\nfloat-value ...
FAILED tests/plugins/test_setuptools_pep621.py::test_split_subtables - assert '[tool.setuptools.packages.find]\nwhere = "src"\n\n[project]\n[project.ent...
FAILED tests/plugins/test_setuptools_pep621.py::test_entrypoints_and_split_subtables - assert '[tool.setuptools.packages.find]\nwhere = "src"\n\n[project]\n[project.ent...
FAILED tests/plugins/test_setuptools_pep621.py::test_empty - assert '[build-system]\nrequires = ["setuptools>=61.2"]\nbuild-backend = "setupto...
FAILED tests/plugins/test_setuptools_pep621.py::test_data_files - assert '[build-system]\nrequires = ["setuptools>=61.2"]\nbuild-backend = "setupto...
============================ 5 failed, 81 passed in 5.75s ============================

With https://github.com/sdispater/tomlkit/pull/246 default value for is_super_table was changed from False to autodetect.

abravalheri commented 2 years ago

Thank you very much @stanislavlevin.

In #60, I am changing the test suite to work for both versions of tomlkit.

stanislavlevin commented 2 years ago

Thank you for the fix :) it works.