diff --git a/README.md b/README.md index b190395..d0ba532 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +> **NOTE:** this is a fork to fix https://github.com/syrusakbary/snapshottest/issues/73 + # SnapshotTest [![travis][travis-image]][travis-url] [![pypi][pypi-image]][pypi-url] [travis-image]: https://img.shields.io/travis/syrusakbary/snapshottest.svg?style=flat @@ -74,7 +76,7 @@ Check the [Django example](https://github.com/syrusakbary/snapshottest/tree/mast ## Disabling terminal colors -Set the environment variable `ANSI_COLORS_DISABLED` (to any value), e.g. +Set the environment variable `ANSI_COLORS_DISABLED` (to any value), e.g. ANSI_COLORS_DISABLED=1 pytest @@ -88,7 +90,7 @@ make develop ``` After developing, ensure your code is formatted properly by running: - + ```sh make format-fix ``` @@ -101,7 +103,7 @@ make lint make test ``` -To test locally on all supported Python versions, you can use +To test locally on all supported Python versions, you can use [tox](https://tox.readthedocs.io/): ```sh diff --git a/setup.py b/setup.py index 70089b7..3b84f3f 100644 --- a/setup.py +++ b/setup.py @@ -9,7 +9,7 @@ setup( name="snapshottest", - version="1.0.0a0", + version="1.0.0a0+memfault0", description="Snapshot testing for pytest, unittest, Django, and Nose", long_description=readme, long_description_content_type="text/markdown", diff --git a/snapshottest/module.py b/snapshottest/module.py index e31b46c..ed8394a 100644 --- a/snapshottest/module.py +++ b/snapshottest/module.py @@ -255,7 +255,10 @@ def assert_match(self, value, name=""): try: prev_snapshot = self.module[self.test_name] except SnapshotNotFound: - self.store(value) # first time this test has been seen + if self.update: + self.store(value) # first time this test has been seen + else: + raise else: try: self.assert_value_matches_snapshot(value, prev_snapshot)