Skip to content

Add push/pop methods to JigDriver #183

@clint-lawrence

Description

@clint-lawrence

The idea here is to setup a the jig into a particular state, then be able to save that at the start of a test. Maybe save/restore would be a better name? Should the state be keep in jig driver or stored locally.

def test():
    jig_state = jig.save()
    jig.mux.switch(...)
    ...
    jig.mux.switch(...)
    ...
    jig.restore(jig_state)

vs

def test():
    jig.push()
    jig.mux.switch(...)
    ...
    jig.mux.switch(...)
    ...
    jig.pop()

Or even a context manager

def test():
    with jig:
        jig.mux.switch(...)
        ...
        jig.mux.switch(...)
        ...

    # state is automatically restored when exiting the `with` block.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions