yahoo-oauth icon indicating copy to clipboard operation
yahoo-oauth copied to clipboard

Yaml file support does not work with latest version of pyaml

Open DMcP89 opened this issue 9 months ago • 0 comments

While testing the library in Python 3.10.7 using pyaml 24.4.0 I ran into a Type error with the yaml handling:

TypeError: load() missing 1 required positional argument: 'Loader'

Running the get_data test yields the same:

Running pytest with args: ['-p', 'vscode_pytest', '--rootdir=/home/dave/workspace/forks/yahoo-oauth', '/home/dave/workspace/forks/yahoo-oauth/tests.py::test_get_data[data_yaml]']
============================= test session starts ==============================
platform linux -- Python 3.10.7, pytest-8.2.0, pluggy-1.5.0
rootdir: /home/dave/workspace/forks/yahoo-oauth
configfile: pyproject.toml
collected 1 item

tests.py F                                                               [100%]

=================================== FAILURES ===================================
___________________________ test_get_data[data_yaml] ___________________________

data = {'ck': 'consumer_key', 'cs': 'consumer_secret'}
data_format = 'data.yaml'

    def test_get_data(data, data_format):
>       data_stored = get_data(data_format)

tests.py:72: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
yahoo_oauth/utils.py:36: in get_data
    return func(filename)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

filename = 'data.yaml'

    def yaml_get_data(filename):
        """Get data from .yml file
        """
        with open(filename, 'rb') as fd:
>           yaml_data = yaml.load(fd)
E           TypeError: load() missing 1 required positional argument: 'Loader'

yahoo_oauth/utils.py:66: TypeError
=========================== short test summary info ============================
FAILED tests.py::test_get_data[data_yaml] - TypeError: load() missing 1 requi...
============================== 1 failed in 0.12s ===============================
Finished running tests!

This is due to a change made with PyYaml, a library that is being used by pyaml: https://github.com/yaml/pyyaml/commit/c2743653bc89e42679ba097b4f9888db47c61d63

DMcP89 avatar May 22 '24 01:05 DMcP89