xflr6 / graphviz

Simple Python interface for Graphviz
https://graphviz.readthedocs.io
MIT License
1.59k stars 209 forks source link

graphiviz-0.20.1 failed tests/test_quoting.py with python 3.12 #209

Closed band-a-prend closed 8 months ago

band-a-prend commented 8 months ago

While trying to build and then run tests with Python 3.12 the following errors occurs:

...
tests/test_quoting.py::test_deprecated_escape[G] FAILED                                                                                                       [ 67%]
tests/test_quoting.py::test_deprecated_escape[E] FAILED                                                                                                       [ 68%]
tests/test_quoting.py::test_deprecated_escape[T] FAILED                                                                                                       [ 68%]
tests/test_quoting.py::test_deprecated_escape[H] FAILED                                                                                                       [ 68%]
tests/test_quoting.py::test_deprecated_escape[L] FAILED                                                                                                       [ 68%]
tests/test_quoting.py::test_deprecated_escape[l] FAILED 
...
==== FAILURES ====
____ test_deprecated_escape[G] ____

recwarn = WarningsRecorder(record=True), char = 'G'

    @pytest.mark.parametrize(
        'char', ['G', 'E', 'T', 'H', 'L', 'l'])
    def test_deprecated_escape(recwarn, char):
        warnings.simplefilter('always')

        escape = eval(rf'"\{char}"')

        assert len(recwarn) == 1
>       w = recwarn.pop(DeprecationWarning)
E       AssertionError: <class 'DeprecationWarning'> not found in warning list

char       = 'G'
escape     = '\\G'
recwarn    = WarningsRecorder(record=True)

tests/test_quoting.py:17: AssertionError
____ test_deprecated_escape[E] ____

recwarn = WarningsRecorder(record=True), char = 'E'

    @pytest.mark.parametrize(
        'char', ['G', 'E', 'T', 'H', 'L', 'l'])
    def test_deprecated_escape(recwarn, char):
        warnings.simplefilter('always')

        escape = eval(rf'"\{char}"')

        assert len(recwarn) == 1
>       w = recwarn.pop(DeprecationWarning)
E       AssertionError: <class 'DeprecationWarning'> not found in warning list

char       = 'E'
escape     = '\\E'
recwarn    = WarningsRecorder(record=True)

tests/test_quoting.py:17: AssertionError
____ test_deprecated_escape[T] ____

recwarn = WarningsRecorder(record=True), char = 'T'

    @pytest.mark.parametrize(
        'char', ['G', 'E', 'T', 'H', 'L', 'l'])
    def test_deprecated_escape(recwarn, char):
        warnings.simplefilter('always')

        escape = eval(rf'"\{char}"')

        assert len(recwarn) == 1
>       w = recwarn.pop(DeprecationWarning)
E       AssertionError: <class 'DeprecationWarning'> not found in warning list

char       = 'T'
escape     = '\\T'
recwarn    = WarningsRecorder(record=True)

tests/test_quoting.py:17: AssertionError
____ test_deprecated_escape[H] ____

recwarn = WarningsRecorder(record=True), char = 'H'

    @pytest.mark.parametrize(
        'char', ['G', 'E', 'T', 'H', 'L', 'l'])
    def test_deprecated_escape(recwarn, char):
        warnings.simplefilter('always')

        escape = eval(rf'"\{char}"')

        assert len(recwarn) == 1
>       w = recwarn.pop(DeprecationWarning)
E       AssertionError: <class 'DeprecationWarning'> not found in warning list

char       = 'H'
escape     = '\\H'
recwarn    = WarningsRecorder(record=True)

tests/test_quoting.py:17: AssertionError
____ test_deprecated_escape[L] ____

recwarn = WarningsRecorder(record=True), char = 'L'

    @pytest.mark.parametrize(
        'char', ['G', 'E', 'T', 'H', 'L', 'l'])
    def test_deprecated_escape(recwarn, char):
        warnings.simplefilter('always')

        escape = eval(rf'"\{char}"')

        assert len(recwarn) == 1
>       w = recwarn.pop(DeprecationWarning)
E       AssertionError: <class 'DeprecationWarning'> not found in warning list

char       = 'L'
escape     = '\\L'
recwarn    = WarningsRecorder(record=True)

tests/test_quoting.py:17: AssertionError
____ test_deprecated_escape[l] ____

recwarn = WarningsRecorder(record=True), char = 'l'

    @pytest.mark.parametrize(
        'char', ['G', 'E', 'T', 'H', 'L', 'l'])
    def test_deprecated_escape(recwarn, char):
        warnings.simplefilter('always')

        escape = eval(rf'"\{char}"')

        assert len(recwarn) == 1
>       w = recwarn.pop(DeprecationWarning)
E       AssertionError: <class 'DeprecationWarning'> not found in warning list

char       = 'l'
escape     = '\\l'
recwarn    = WarningsRecorder(record=True)

tests/test_quoting.py:17: AssertionError
...
==== short test summary info ====
FAILED tests/test_quoting.py::test_deprecated_escape[G] - AssertionError: <class 'DeprecationWarning'> not found in warning list
FAILED tests/test_quoting.py::test_deprecated_escape[E] - AssertionError: <class 'DeprecationWarning'> not found in warning list
FAILED tests/test_quoting.py::test_deprecated_escape[T] - AssertionError: <class 'DeprecationWarning'> not found in warning list
FAILED tests/test_quoting.py::test_deprecated_escape[H] - AssertionError: <class 'DeprecationWarning'> not found in warning list
FAILED tests/test_quoting.py::test_deprecated_escape[L] - AssertionError: <class 'DeprecationWarning'> not found in warning list
FAILED tests/test_quoting.py::test_deprecated_escape[l] - AssertionError: <class 'DeprecationWarning'> not found in warning list

The tarball is taken from https://github.com/xflr6/graphviz/archive/refs/tags/0.20.1.tar.gz

With Python 3.11 the error doesn't take place.

xflr6 commented 8 months ago

Thanks for reporting, fixed in 5ce9fc5de4f2284baa27d7a8d68ab0885d032868.

band-a-prend commented 8 months ago

Great thanks for fix!