Skip to content

Commit 5316f90

Browse files
author
esblinov
committed
more tests
1 parent 04b1848 commit 5316f90

1 file changed

Lines changed: 36 additions & 0 deletions

File tree

tests/units/decorators/test_superfunction.py

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -403,3 +403,39 @@ def test_there_are_no_exceptions_if_not_tilde_mode_and_in_function_is_return_tru
403403
def function():
404404
with generator_context:
405405
return True
406+
407+
408+
def test_async_function_with_all_content_in_generator_context():
409+
@superfunction
410+
def function():
411+
with generator_context:
412+
return True
413+
414+
assert run(function()) is None
415+
416+
417+
def test_async_function_with_all_content_in_sync_context():
418+
@superfunction
419+
def function():
420+
with sync_context:
421+
return True
422+
423+
assert run(function()) is None
424+
425+
426+
def test_usual_tilde_function_with_all_content_in_generator_context():
427+
@superfunction
428+
def function():
429+
with generator_context:
430+
return True
431+
432+
assert ~function() is None
433+
434+
435+
def test_usual_tilde_function_with_all_content_in_async_context():
436+
@superfunction
437+
def function():
438+
with async_context:
439+
return True
440+
441+
assert ~function() is None

0 commit comments

Comments
 (0)