File: test_invalid_bytes_single_file.py

package info (click to toggle)
python-syrupy 4.9.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,368 kB
  • sloc: python: 5,978; makefile: 3
file content (15 lines) | stat: -rw-r--r-- 514 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
def test_raises_informative_type_error_when_serializing_non_bytes(testdir):
    testdir.makepyfile(
        test_file="""
        from syrupy.extensions.single_file import SingleFileSnapshotExtension

        def test_case(snapshot):
            assert {"x": 0} == snapshot(extension_class=SingleFileSnapshotExtension)
        """
    )

    result = testdir.runpytest("-v")
    assert result.ret == 1
    result.stdout.re_match_lines(
        (r".*TypeError: Can't serialize.*You must convert the data.*",)
    )