Skip to content

Allow nested ordering and interleaved order #5

Description

@yalon

Enhance the ordering groups to allow nesting, and create a new "interleaved" order group.

Nesting is helpful to allow for a more modular test code - you can write methods that create a group of functions that execute in some order.

group1 = EnforceSequentialOrder()
with group1:
  foo1()
  foo2()

# This will append to the same group
with group1:
  foo3()
  foo4()

# This will create a group that doesn't care about order:
group2 = UnorderdGroup()
with group2:
  bar1()
  bar2()

# Now we can do this:

with AllowInterleavedOrder():
  group1()
  group2()

# This means that the following is valid:
#1. foo1, foo2, bar1, foo3, foo4, bar2
#2. bar2, foo1, bar1, foo2, foo3, foo4
#
# This is invalid:
#1. foo2, foo1, ...
#2. missing bar
# ...
#  You get the picture :)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions