Use inspect to properly detect generators. Fixes #2129
This commit is contained in:
12
testing/test_compat.py
Normal file
12
testing/test_compat.py
Normal file
@@ -0,0 +1,12 @@
|
||||
from _pytest.compat import is_generator
|
||||
|
||||
|
||||
def test_is_generator():
|
||||
def zap():
|
||||
yield
|
||||
|
||||
def foo():
|
||||
pass
|
||||
|
||||
assert is_generator(zap)
|
||||
assert not is_generator(foo)
|
||||
Reference in New Issue
Block a user