pyyaml/tests/test_dump_load.py
Matt Davis a98fd6088e
Move tests to pytest
* custom pytest collector and item to surface pyyaml data-driven tests as individual pytest unit tests
* moved some true unit tests to pytest-native tests
* deprecated `setup.py test` custom command
* updated Makefile to use pytest
* align test matrix with planned 7.x Python support
2023-11-10 11:37:15 -08:00

15 lines
254 B
Python

import pytest
import yaml
def test_dump():
assert yaml.dump(['foo'])
def test_load_no_loader():
with pytest.raises(TypeError):
yaml.load("- foo\n")
def test_load_safeloader():
assert yaml.load("- foo\n", Loader=yaml.SafeLoader)