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

async support #6

Open
bung87 opened this issue Jun 7, 2021 · 2 comments
Open

async support #6

bung87 opened this issue Jun 7, 2021 · 2 comments

Comments

@bung87
Copy link

bung87 commented Jun 7, 2021

am wondering whether it's not hard add async pragma to method and prepend waitFor to all methods call

@jyapayne
Copy link
Owner

jyapayne commented Jun 8, 2021

Is there a benefit to doing this? I would suggest simply calling async methods inside the test bodies.

@bung87
Copy link
Author

bung87 commented Jun 8, 2021

to make the test code clean , so there's no much waitFor , just await, like asynctest does

proc someAsyncProc {.async.} =  # perform some async operations using await  
  discard
suite "test async proc":
  setup:    # invoke await in the test setup:   
    await someAsyncProc()
  teardown:    # invoke await in the test teardown:    
    await someAsyncProc()
  test "async test":    # invoke await in tests:    
    await someAsyncProc()

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