mirror of
https://github.com/yaml/pyyaml.git
synced 2026-02-06 18:00:08 +00:00
* 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
15 lines
254 B
Python
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)
|