Skip to content

Add the ability to add to the tearDown for a running test #93

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

Closed
nex3 opened this issue Apr 24, 2015 · 5 comments
Closed

Add the ability to add to the tearDown for a running test #93

nex3 opened this issue Apr 24, 2015 · 5 comments
Assignees
Labels
type-enhancement A request for a change that isn't a bug
Milestone

Comments

@nex3
Copy link
Member

nex3 commented Apr 24, 2015

This is an idea that comes from scheduled_test. It makes it possible to create testing APIs that can clean up after themselves without the user having to explicitly pipe them to the tearDown. For example, a Sandbox class might tear down the sandbox directory; ScheduledProcess uses this to kill dangling processes.

@nex3 nex3 added the type-enhancement A request for a change that isn't a bug label Apr 24, 2015
@nex3 nex3 added this to the 1.0.0 milestone Apr 24, 2015
@greglittlefield-wf
Copy link
Contributor

Any updates on this issue? This feature would be nice to have.

@nex3
Copy link
Member Author

nex3 commented Oct 29, 2015

None yet. If you want to contribute though, I'd gladly take a patch!

@greglittlefield-wf
Copy link
Contributor

Cool, I'll look into it, then. Thanks!

@greglittlefield-wf
Copy link
Contributor

It would be expected that any tearDowns added inside a test are run directly afterwards, before any group tearDowns, correct?

E.g., the following:

group('', () {
  tearDown(() => print('tearDown (group)');

  test('', {
    tearDown(() => print('tearDown (test)'));
    print('test');
  });
}

would output:

test
tearDown (test)
tearDown (group)

@nex3
Copy link
Member Author

nex3 commented Nov 3, 2015

That's right. If multiple tear-downs are added within a test, they should also run in last-in-first-out order.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

2 participants