raimon49 / pip-licenses

Dump the license list of packages installed with pip.
MIT License
298 stars 42 forks source link

test_format_rst_without_filter fails with wcwidth>=0.2.10 #178

Closed danigm closed 6 months ago

danigm commented 6 months ago

With a modern version of wcwidth this test fail. Looks like docutils is not raising any error anymore.

______________________________________________ TestGetLicenses.test_format_rst_without_filter ______________________________________________

self = <test_piplicenses.TestGetLicenses testMethod=test_format_rst_without_filter>

    @unittest.skipIf(
        sys.version_info < (3, 6, 0),
        "To unsupport Python 3.5 in the near future",
    )
    def test_format_rst_without_filter(self) -> None:
        piplicenses.importlib_metadata.distributions = (
            importlib_metadata_distributions_mocked
        )
        format_rst_args = ["--format=rst"]
        args = self.parser.parse_args(format_rst_args)
        table = create_licenses_table(args)

        self.assertIn("l", table.align.values())
        self.assertTrue(table.border)
        self.assertTrue(table.header)
        self.assertEqual("+", table.junction_char)
        self.assertEqual(RULE_ALL, table.hrules)
>       with self.assertRaises(docutils.utils.SystemMessage):
E       AssertionError: SystemMessage not raised

test_piplicenses.py:579: AssertionError
raimon49 commented 6 months ago

@danigm Thanks for the very detailed report.

I will attempt to delete the broken test case.

raimon49 commented 6 months ago

@danigm This problem was fixed in the master branch.

Also, since you seem to be the maintainer of the OS package, I have shipped v4.3.4 of pip-licenses as a release tag.