Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The test_jsonyaml_plugin test fails on python3.13 #642

Open
awsms opened this issue Dec 25, 2024 · 0 comments
Open

The test_jsonyaml_plugin test fails on python3.13 #642

awsms opened this issue Dec 25, 2024 · 0 comments

Comments

@awsms
Copy link

awsms commented Dec 25, 2024

=========================================================================================================== FAILURES ============================================================================================================
________________________________________________________________________________________________________ testYamlPlugin _________________________________________________________________________________________________________

audiofile = <eyed3.mp3.Mp3AudioFile object at 0x792397581400>

    def testYamlPlugin(audiofile):
        _initTag(audiofile)
    
        omap, omap_list = "", "  "
        if sys.version_info[:2] <= (3, 7):
            omap = " !!omap"
            omap_list = "- "
    
>       _assertFormat("yaml", audiofile, f"""
    ---
    _eyeD3: %(version)s
    album: Suffer
    artist: Bad Religion
    best_release_date: '1988'
    info:
      size_bytes: %(size_bytes)d
      time_secs: 10.68
    path: %(path)s
    recording_date: '1987'
    release_date: '1988'
    title: Suffer
    track_num:{omap}
    {omap_list}count: 9
    {omap_list}total: 15
    """)

tests/test_jsonyaml_plugin.py:69: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
tests/test_jsonyaml_plugin.py:30: in _assertFormat
    output = _runPlugin(audio_file, plugin)
tests/test_jsonyaml_plugin.py:22: in _runPlugin
    assert main.main(args, config) == 0
eyed3/main.py:41: in main
    eyed3.utils.walk(args.plugin, p, excludes=args.excludes, fs_encoding=args.fs_encoding,
eyed3/utils/__init__.py:71: in walk
    handler.handleFile(os.path.abspath(path))
eyed3/plugins/yamltag.py:29: in handleFile
    print(yaml.safe_dump(audioFileToJson(self.audio_file),
/usr/lib/python3.13/site-packages/ruamel/yaml/main.py:1260: in safe_dump
    error_deprecation('safe_dump', 'dump', arg="typ='safe', pure=True")
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

fun = 'safe_dump', method = 'dump', arg = "typ='safe', pure=True", comment = 'instead of'

    def error_deprecation(fun: Any, method: Any, arg: str = '', comment: str = 'instead of') -> None:  # NOQA
        import inspect
    
        s = f'\n"{fun}()" has been removed, use\n\n  yaml = YAML({arg})\n  yaml.{method}(...)\n\n{comment}'  # NOQA
        try:
            info = inspect.getframeinfo(inspect.stack()[2][0])
            context = '' if info.code_context is None else "".join(info.code_context)
            s += f' file "{info.filename}", line {info.lineno}\n\n{context}'
        except Exception as e:
            _ = e
        s += '\n'
        if sys.version_info < (3, 10):
            raise AttributeError(s)
        else:
>           raise AttributeError(s, name=None)
E           AttributeError: 
E           "safe_dump()" has been removed, use
E           
E             yaml = YAML(typ='safe', pure=True)
E             yaml.dump(...)
E           
E           instead of file "/home/me/.cache/yay/python-eyed3/src/eyeD3-0.9.7/eyed3/plugins/yamltag.py", line 29
E           
E                           print(yaml.safe_dump(audioFileToJson(self.audio_file),

/usr/lib/python3.13/site-packages/ruamel/yaml/main.py:1039: AttributeError
======================================================================================================= warnings summary ========================================================================================================
tests/test_classic_plugin.py:879
  /home/me/.cache/yay/python-eyed3/src/eyeD3-0.9.7/tests/test_classic_plugin.py:879: PytestUnknownMarkWarning: Unknown pytest.mark.audiofile_name - is this a typo?  You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/how-to/mark.html
    @pytest.mark.audiofile_name("unknown-frame-ASDF.mp3")

tests/test_jsonyaml_plugin.py::testJsonPlugin
tests/test_jsonyaml_plugin.py::testYamlPlugin
  /home/me/.cache/yay/python-eyed3/src/eyeD3-0.9.7/eyed3/plugins/jsontag.py:42: DeprecationWarning: Use Tag.getBestDate() instead
    member = getattr(tag, name)

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
==================================================================================================== short test summary info ====================================================================================================
FAILED tests/test_jsonyaml_plugin.py::testYamlPlugin - AttributeError: 
=========================================================================================== 1 failed, 183 passed, 3 warnings in 2.69s ===========================================================================================

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant