You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
JSONSnapshotExtension will not work with Python 3.7. syrupy/extensions/json/__init__.py imports SerializableData from syrupy.types ONLY if TYPE_CHECKING is True. In Python 3.7, TYPE_CHECKING is false. Trying to use JSONSnapshotExtension in Python 3.7 will result in a runtime error upon import: NameError: name 'SerializableData' is not defined
To reproduce
Steps to reproduce the behavior:
In a Python 3.7 environment, try to import from syrupy.extensions.json import JSONSnapshotExtension
You will see error: NameError: name 'SerializableData' is not defined
Expected behavior
The code should handle this scenario
Environment (please complete the following information):
OS: Mac OSX
Syrupy Version: 1.7.0
Python Version: 3.7.7
The text was updated successfully, but these errors were encountered:
So I tried this with 1.7.2, and now it's also happening with 'PropertyPath' (line 57). I assume it'll happen with PropertyMatcher too (line 59). All the rest looks good. @noahnu
Edit: yes, fixing those 2 lines makes it work for me.
Describe the bug
JSONSnapshotExtension will not work with Python 3.7.
syrupy/extensions/json/__init__.py
imports SerializableData from syrupy.types ONLY if TYPE_CHECKING is True. In Python 3.7, TYPE_CHECKING is false. Trying to use JSONSnapshotExtension in Python 3.7 will result in a runtime error upon import:NameError: name 'SerializableData' is not defined
To reproduce
Steps to reproduce the behavior:
In a Python 3.7 environment, try to import
from syrupy.extensions.json import JSONSnapshotExtension
You will see error:
NameError: name 'SerializableData' is not defined
Expected behavior
The code should handle this scenario
Environment (please complete the following information):
The text was updated successfully, but these errors were encountered: