Skip to content

Unit tests fail with PyYAML 5.1b3 #266

@amoralej

Description

@amoralej

While testing gabbi with updated pyyaml, it fails to discover unit tests in:

Failures during discovery

`b'--- import errors ---\nFailed to call load_tests:\nTraceback (most recent call last):\n File "/home/amoralej/tmp/python-gabbi/gabbi-1.44.0/.tox/py37/lib/python3.7/site-packages/unittest2/loader.py", line 147, in loadTestsFromModule\n return load_tests(self, tests, pattern)\n File "/home/amoralej/tmp/python-gabbi/gabbi-1.44.0/gabbi/tests/test_unsafe_yaml.py", line 49, in load_tests\n **BUILD_TEST_ARGS)\n File "/home/amoralej/tmp/python-gabbi/gabbi-1.44.0/gabbi/driver.py", line 118, in build_tests\n safe=safe_yaml)\n File "/home/amoralej/tmp/python-gabbi/gabbi-1.44.0/gabbi/utils.py", line 111, in load_yaml\n return load(source.read())\n File "/home/amoralej/tmp/python-gabbi/gabbi-1.44.0/.tox/py37/lib/python3.7/site-packages/yaml/init.py", line 113, in load\n return loader.get_single_data()\n File "/home/amoralej/tmp/python-gabbi/gabbi-1.44.0/.tox/py37/lib/python3.7/site-packages/yaml/constructor.py", line 43, in get_single_data\n return self.construct_document(node)\n File "/home/amoralej/tmp/python-gabbi/gabbi-1.44.0/.tox/py37/lib/python3.7/site-packages/yaml/constructor.py", line 52, in construct_document\n for dummy in generator:\n File "/home/amoralej/tmp/python-gabbi/gabbi-1.44.0/.tox/py37/lib/python3.7/site-packages/yaml/constructor.py", line 404, in construct_yaml_map\n value = self.construct_mapping(node)\n File "/home/amoralej/tmp/python-gabbi/gabbi-1.44.0/.tox/py37/lib/python3.7/site-packages/yaml/constructor.py", line 210, in construct_mapping\n return super().construct_mapping(node, deep=deep)\n File "/home/amoralej/tmp/python-gabbi/gabbi-1.44.0/.tox/py37/lib/python3.7/site-packages/yaml/constructor.py", line 135, in construct_mapping\n value = self.construct_object(value_node, deep=deep)\n File "/home/amoralej/tmp/python-gabbi/gabbi-1.44.0/.tox/py37/lib/python3.7/site-packages/yaml/constructor.py", line 92, in construct_object\n data = constructor(self, node)\n File "/home/amoralej/tmp/python-gabbi/gabbi-1.44.0/.tox/py37/lib/python3.7/site-packages/yaml/constructor.py", line 420, in construct_undefined\n node.start_mark)\nyaml.constructor.ConstructorError: could not determine a constructor for the tag '!NanChecker'\n in "", line 8, column 16:\n $.nan: !NanChecker {}\n ^\n'

Note that, although PyYAML is capped in requirements.txt, it's a problem when using it in a distro, as Fedora where PyYAML-5.1b3 has been added.

Root cause for this issue seems to be yaml/pyyaml@33644a0 which has introduced changes in yaml loading.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions