8000 How to use pytest.approx() with syrupy · Issue #438 · syrupy-project/syrupy · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
How to use pytest.approx() with syrupy #438
Closed
@hashstat

Description

@hashstat

We have a bunch of tests that perform computations using pandas, numpy, and other scientific libraries and produce a dictionary containing the resulting key-value pairs. Some of the values are slightly different when run on different platforms (i.e. macOS vs Linux), so we wrap those values with pytest.approx() to accommodate those minor and acceptable differences.

Digging into the syrupy code, the final comparison between the test value and the snapshot is performed against serialized data, so it appears that pytest.approx() cannot be used. Is that correct? Or can you suggest a way to allow these two great features to be used together?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0