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

Generated tests are sorted out of order #148

Open
datavistics opened this issue Nov 4, 2020 · 2 comments
Open

Generated tests are sorted out of order #148

datavistics opened this issue Nov 4, 2020 · 2 comments

Comments

@datavistics
Copy link

generated snapshot:
snapshots['test_foo 1'] = 'test'

snapshots['test_foo 10'] = 'test'

snapshots['test_foo 11'] = 'test'
.
.
.
snapshots['test_foo 2'] = 'test'
.
.
.

Is there a way to get them to generate in numerical order?

@paulmelnikow
Copy link
Collaborator

paulmelnikow commented Nov 4, 2020

Could you provide the test snippet that generates those snapshots?

@datavistics
Copy link
Author

datavistics commented Nov 10, 2020

Sorry for the delay @paulmelnikow

def test_stuff(snapshot):
    for i in range(15):
        snapshot.assert_match(i)

Produces

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

from snapshottest import Snapshot


snapshots = Snapshot()

snapshots['test_stuff 1'] = 0

snapshots['test_stuff 10'] = 9

snapshots['test_stuff 11'] = 10

snapshots['test_stuff 12'] = 11

snapshots['test_stuff 13'] = 12

snapshots['test_stuff 14'] = 13

snapshots['test_stuff 15'] = 14

snapshots['test_stuff 2'] = 1

snapshots['test_stuff 3'] = 2

snapshots['test_stuff 4'] = 3

snapshots['test_stuff 5'] = 4

snapshots['test_stuff 6'] = 5

snapshots['test_stuff 7'] = 6

snapshots['test_stuff 8'] = 7

snapshots['test_stuff 9'] = 8

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

2 participants