oprypin / pytest-golden

Plugin for pytest that offloads expected outputs to data files
MIT License
23 stars 2 forks source link

Unable to roundtrip CR-LF #1

Open emosenkis opened 2 years ago

emosenkis commented 2 years ago

Try this:

@pytest.mark.golden_test("foo.yaml")
def test_rn(golden):
  assert "foo\r\nbar\r\n" == golden.out.get("foo")
$ pytest --update-goldens -vv
test_rn.py::test_rn[foo.yaml] PASSED
$ pytest -vv
...
    @pytest.mark.golden_test("foo.yaml")
    def test_rn(golden):
>     assert "foo\r\nbar\r\n" == golden.out.get("foo")
E     AssertionError: assert 'foo\r\nbar\r\n' == 'foo\nbar\n'
E       - foo
E       + foo
E       ?    +
E       - bar
E       + bar
E       ?    +
...