use flake8 in the flakes testenv

and extend the ignored errors list so pytest is clean
we def have to trim down that one
This commit is contained in:
Ronny Pfannschmidt 2015-07-24 10:05:54 +02:00
parent e035f57535
commit 1de38a25fc
4 changed files with 20 additions and 13 deletions

View File

@ -2,7 +2,14 @@
"""
pytest: unit and functional testing with Python.
"""
__all__ = ['main']
__all__ = [
'main',
'UsageError',
'cmdline',
'hookspec',
'hookimpl',
'__version__',
]
if __name__ == '__main__': # if run as a script or by 'python -m pytest'
# we trigger the below "else" condition by the following import

View File

@ -1,7 +1,4 @@
import os
import pytest
import shutil
import py
pytest_plugins = "pytester",
@ -57,7 +54,7 @@ class TestNewAPI:
def test_cache_reportheader(testdir):
p = testdir.makepyfile("""
testdir.makepyfile("""
def test_hello():
pass
""")
@ -72,7 +69,7 @@ def test_cache_show(testdir):
result.stdout.fnmatch_lines([
"*cache is empty*"
])
p = testdir.makeconftest("""
testdir.makeconftest("""
def pytest_configure(config):
config.cache.set("my/name", [1,2,3])
config.cache.set("other/some", {1:2})

View File

@ -54,11 +54,11 @@ class TestLastFailed:
])
def test_failedfirst_order(self, testdir):
always_pass = testdir.tmpdir.join('test_a.py').write(py.code.Source("""
testdir.tmpdir.join('test_a.py').write(py.code.Source("""
def test_always_passes():
assert 1
"""))
always_fail = testdir.tmpdir.join('test_b.py').write(py.code.Source("""
testdir.tmpdir.join('test_b.py').write(py.code.Source("""
def test_always_fails():
assert 0
"""))
@ -114,7 +114,7 @@ class TestLastFailed:
@pytest.mark.skipif("sys.version_info < (2,6)")
def test_lastfailed_usecase_splice(self, testdir, monkeypatch):
monkeypatch.setenv("PYTHONDONTWRITEBYTECODE", 1)
p1 = testdir.makepyfile("""
testdir.makepyfile("""
def test_1():
assert 0
""")
@ -137,7 +137,7 @@ class TestLastFailed:
])
def test_lastfailed_xpass(self, testdir):
rep = testdir.inline_runsource("""
testdir.inline_runsource("""
import pytest
@pytest.mark.xfail
def test_hello():

View File

@ -33,8 +33,8 @@ commands= py.test --genscript=pytest1
[testenv:flakes]
basepython = python2.7
deps = pytest-flakes>=0.2
commands = py.test --flakes -m flakes _pytest testing
deps = flake8
commands = flake8 pytest.py _pytest testing
[testenv:py27-xdist]
deps=pytest-xdist>=1.13
@ -148,5 +148,8 @@ rsyncdirs=tox.ini pytest.py _pytest testing
python_files=test_*.py *_test.py testing/*/*.py
python_classes=Test Acceptance
python_functions=test
pep8ignore = E401 E225 E261 E128 E124 E302
norecursedirs = .tox ja .hg cx_freeze_source
[flake8]
ignore =E401,E225,E261,E128,E124,E301,E302,E121,E303,W391,E501,E231,E126,E701,E265,E241,E251,E226,E101,W191,E131,E203,E122,E123,E271,E712,E222,E127,E125,E221,W292,E111,E113,E293,E262,W293,E129,E702,E201,E272,E202