-
Notifications
You must be signed in to change notification settings - Fork 525
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
make style=... consistent for unquoted scalar tokens
- Loading branch information
Showing
2 changed files
with
19 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import pytest | ||
|
||
import yaml | ||
from yaml.tokens import StreamStartToken, ScalarToken, StreamEndToken | ||
|
||
|
||
_loaders = (yaml.SafeLoader,) | ||
if yaml.__with_libyaml__: | ||
_loaders += (yaml.CSafeLoader,) | ||
|
||
|
||
@pytest.mark.parametrize('loader_cls', _loaders) | ||
def test_scan_produces_empty_string_style_for_scalar_node(loader_cls): | ||
start, scalar, end = yaml.scan('example', Loader=loader_cls) | ||
assert isinstance(start, StreamStartToken) | ||
assert isinstance(scalar, ScalarToken) | ||
assert scalar.style == '' | ||
assert isinstance(end, StreamEndToken) |