Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GenericRepr and Snapshot are changing their places in Import statement #121

Open
jaswanthm1855 opened this issue Jul 17, 2020 · 2 comments

Comments

@jaswanthm1855
Copy link

jaswanthm1855 commented Jul 17, 2020

Whenever I am performing snapshot test on functions which returns DTOs,
The import statement is keep on changing or modifying,

For first run I will get - from snapshottest import Snapshot, GenericRepr
then for next run it is changing - from snapshottest import GenericRepr, Snapshot

Example File is as follows:
snapshot_keep_on_modifying.txt

The above file contents are like this

# -*- coding: utf-8 -*-
# snapshottest: v1 - https://goo.gl/zC4yUc
from __future__ import unicode_literals

from snapshottest import Snapshot, GenericRepr


snapshots = Snapshot()

snapshots['TestExample.test_run_example result'] = (
    [
        GenericRepr("ExampleDTO(example_id='f2c02d98-f311-4ab2-8673-3daa00757002', name='example1', description='desc1')"),
        GenericRepr("ExampleDTO(example_id='aa66c40f-6d93-484a-b418-984716514c7b', name='example2', description='desc2')"),
    ],
    3
)
@davidshepherd7
Copy link
Collaborator

Hi, I had a similar problem which I think is fixed by one of my PRs, probably #116 but I can't really remember. Hopefully the fix will be merged soon.

@paulmelnikow
Copy link
Collaborator

@jaswanthm1855 Could you try the latest commit to master and see if that fixes the problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants