Add xfail test for vulture bug.

This commit is contained in:
Florian Bruhin 2015-11-02 18:25:16 +01:00
parent 144acc9f91
commit bb4152d705

View File

@ -138,3 +138,26 @@ def test_unused_method_camelcase(vultdir):
Foo()
""")
assert not vultdir.run()
@pytest.mark.xfail(
True, reason="https://bitbucket.org/jendrikseipp/vulture/issues/10/")
def test_globals_bug(vultdir):
"""Vulture has a bug where it detects globals as unused.
When this test starts XPASSing, we know it's been fixed.
"""
vultdir.makepyfile(foo="""
import bar
bar.attr = True
bar.blub()
""")
vultdir.makepyfile(bar="""
attr = False
def blub():
if attr:
print("Hey!")
""")
assert not vultdir.run()