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

Proposal: Add BeforeFirst and AfterLast blocks #169

Open
w0rp opened this issue Jul 6, 2018 · 0 comments
Open

Proposal: Add BeforeFirst and AfterLast blocks #169

w0rp opened this issue Jul 6, 2018 · 0 comments

Comments

@w0rp
Copy link

w0rp commented Jul 6, 2018

I realised that for ALE, a lot of tests could run faster if some set up and tear down code only runs once for each file. After spending some time trying to think of names for blocks like that which are self-explanatory, I came up with BeforeFirst and AfterLast. These would be analogous to setUpClass and tearDownClass for Python unit test classes.

You could use both types of block together.

BeforeFirst:
   let g:set_once = 3

AfterLast:
   unlet! g:set_once

Before:
  let g:set_before_every_test = 3

After:
  unlet! g:set_before_every_test

You could use AfterLast to clean up data from a Before block, if you know you set up some data before every test, but only have to remove it after all of the tests have been run.

Before:
  let g:set_before_every_test = 3

AfterLast:
  unlet! g:set_before_every_test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants