Skip to content

tests fail on python 3.14 #445

Open
Open

Description

@imnotpoz

caught by nixos CI: https://hydra.nixos.org/build/336720542/log

and confirmed by me locally, here's the logs:

./cpplint_clitest.py

cpplint_clitest.log

./cpplint_unittest.py
$ ./cpplint_unittest.py
======================================================================================================== test session starts =========================================================================================================
platform linux -- Python 3.14.4, pytest-9.0.3, pluggy-1.6.0
rootdir: /home/poz/Sources/cpplint
configfile: pyproject.toml
plugins: cov-nixpkgs-stub-1.0.0, timeout-2.4.0
timeout: 481.0s
timeout method: signal
timeout func_only: False
collected 205 items                                                                                                                                                                                                                  

cpplint_unittest.py .......................................................................................................................................................................................................... [ 98%]
..F                                                                                                                                                                                                                            [100%]

============================================================================================================== FAILURES ==============================================================================================================
__________________________________________________________________________________________________ TestQuiet.testQuietWithoutErrors __________________________________________________________________________________________________

self = <cpplint_unittest.TestQuiet object at 0x76bc9bef95b0>

    def testQuietWithoutErrors(self):
        # This will succeed. We filtered out all the known errors for that file.
        (return_code, output) = self._runCppLint(
            "--quiet", "--filter=" + "-legal/copyright," + "-build/header_guard"
        )
        assert return_code == 0, output
        # No cpplint errors are printed since there were no errors.
        assert "[legal/copyright]" not in output
        assert "[build/header_guard]" not in output
        # --quiet was specified and there were no errors:
        # skip the printing of 'Done processing' and 'Total errors..'
        assert "Done processing" not in output
        assert "Total errors found:" not in output
        # Output with no errors must be completely blank!
>       assert output == ""
E       assert '/home/poz/So...arget_file:\n' == ''
E         
E         + /home/poz/Sources/cpplint/cpplint.py:7553: DeprecationWarning: codecs.open() is deprecated. Use open() instead.
E         +   with codecs.open(filename, "r", "utf8", "replace") as target_file:

cpplint_unittest.py:7209: AssertionError
====================================================================================================== short test summary info =======================================================================================================
FAILED cpplint_unittest.py::TestQuiet::testQuietWithoutErrors - assert '/home/poz/So...arget_file:\n' == ''
=================================================================================================== 1 failed, 204 passed in 0.71s ====================================================================================================

Activity

  1. imnotpoz commented on Jul 13, 2026

    @imnotpoz
    Author

    seems like #405 fixes this (NixOS/nixpkgs#541487), although it's not in the latest release so I'll leave this open

  2. cclauss commented on Jul 13, 2026

    @cclauss
    Member

    https://docs.python.org/3/library/codecs.html#codecs.open is scheduled to be removed in Python 3.19 in 4+ years.

    @aaronliu0130 Should deprecation warnings cause our pytests to fail?

  3. aaronliu0130 commented on Jul 13, 2026

    @aaronliu0130
    Member

    Yes, since that means there's something in the code we need to address. What we need to do here is prepare and release a new version. (Though I believe the former also requires us to review the five outstanding PRs.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions