Giter VIP home page Giter VIP logo

pytest_cache_assert's Introduction

pytest_cache_assert

Warning

This project is deprecated in favor of syrupy, which has a larger user base and more features.

To migrate:

  1. Add the syrupy dependency and remove pytest-cache-assert
  2. In your test, replace the fixture argument assert_against_cache with snapshot
    1. Then replace assert_against_cache(data) with assert data == snapshot
  3. Remove the tests/assert-cache directory

See an example of a project that was migrated here: https://github.com/KyleKing/tail-jsonl/commit/c3b32e20ad88407555b445ba796adda3cfe200d1

If you run into any issue migrating or have questions, feel free to open an issue on GitHub: https://github.com/KyleKing/pytest_cache_assert/issues.

Cache assertion data to simplify regression testing of complex serializable data

Documentation can be found on Github (./docs), PyPi, or Hosted!

pytest_cache_assert's People

Contributors

dependabot[bot] avatar github-actions[bot] avatar kyleking avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

pytest_cache_assert's Issues

Support Specific Cache Files

Better support pointing to a specific cache file. Right now, setting cache_dir and cache_name works, but it adds the extra README.md file, which is imprecise when cache-assert doesn't actually create the folder

Implement Write-Always

Large diffs are hard to read in CLI output, so always write to the cached file even if an AssertionError was found (that way the changes can be reviewed in VCS)

Only downside is that a repeated test, such as one run with pytest-watcher will appear flaky so this feature will be opt-in only

Either set globally or per-fixture with an argument

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.