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:
parent
e035f57535
commit
1de38a25fc
|
@ -2,7 +2,14 @@
|
||||||
"""
|
"""
|
||||||
pytest: unit and functional testing with Python.
|
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'
|
if __name__ == '__main__': # if run as a script or by 'python -m pytest'
|
||||||
# we trigger the below "else" condition by the following import
|
# we trigger the below "else" condition by the following import
|
||||||
|
|
|
@ -1,7 +1,4 @@
|
||||||
import os
|
|
||||||
import pytest
|
import pytest
|
||||||
import shutil
|
|
||||||
import py
|
|
||||||
|
|
||||||
pytest_plugins = "pytester",
|
pytest_plugins = "pytester",
|
||||||
|
|
||||||
|
@ -57,7 +54,7 @@ class TestNewAPI:
|
||||||
|
|
||||||
|
|
||||||
def test_cache_reportheader(testdir):
|
def test_cache_reportheader(testdir):
|
||||||
p = testdir.makepyfile("""
|
testdir.makepyfile("""
|
||||||
def test_hello():
|
def test_hello():
|
||||||
pass
|
pass
|
||||||
""")
|
""")
|
||||||
|
@ -72,7 +69,7 @@ def test_cache_show(testdir):
|
||||||
result.stdout.fnmatch_lines([
|
result.stdout.fnmatch_lines([
|
||||||
"*cache is empty*"
|
"*cache is empty*"
|
||||||
])
|
])
|
||||||
p = testdir.makeconftest("""
|
testdir.makeconftest("""
|
||||||
def pytest_configure(config):
|
def pytest_configure(config):
|
||||||
config.cache.set("my/name", [1,2,3])
|
config.cache.set("my/name", [1,2,3])
|
||||||
config.cache.set("other/some", {1:2})
|
config.cache.set("other/some", {1:2})
|
||||||
|
|
|
@ -54,11 +54,11 @@ class TestLastFailed:
|
||||||
])
|
])
|
||||||
|
|
||||||
def test_failedfirst_order(self, testdir):
|
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():
|
def test_always_passes():
|
||||||
assert 1
|
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():
|
def test_always_fails():
|
||||||
assert 0
|
assert 0
|
||||||
"""))
|
"""))
|
||||||
|
@ -114,7 +114,7 @@ class TestLastFailed:
|
||||||
@pytest.mark.skipif("sys.version_info < (2,6)")
|
@pytest.mark.skipif("sys.version_info < (2,6)")
|
||||||
def test_lastfailed_usecase_splice(self, testdir, monkeypatch):
|
def test_lastfailed_usecase_splice(self, testdir, monkeypatch):
|
||||||
monkeypatch.setenv("PYTHONDONTWRITEBYTECODE", 1)
|
monkeypatch.setenv("PYTHONDONTWRITEBYTECODE", 1)
|
||||||
p1 = testdir.makepyfile("""
|
testdir.makepyfile("""
|
||||||
def test_1():
|
def test_1():
|
||||||
assert 0
|
assert 0
|
||||||
""")
|
""")
|
||||||
|
@ -137,7 +137,7 @@ class TestLastFailed:
|
||||||
])
|
])
|
||||||
|
|
||||||
def test_lastfailed_xpass(self, testdir):
|
def test_lastfailed_xpass(self, testdir):
|
||||||
rep = testdir.inline_runsource("""
|
testdir.inline_runsource("""
|
||||||
import pytest
|
import pytest
|
||||||
@pytest.mark.xfail
|
@pytest.mark.xfail
|
||||||
def test_hello():
|
def test_hello():
|
||||||
|
|
9
tox.ini
9
tox.ini
|
@ -33,8 +33,8 @@ commands= py.test --genscript=pytest1
|
||||||
|
|
||||||
[testenv:flakes]
|
[testenv:flakes]
|
||||||
basepython = python2.7
|
basepython = python2.7
|
||||||
deps = pytest-flakes>=0.2
|
deps = flake8
|
||||||
commands = py.test --flakes -m flakes _pytest testing
|
commands = flake8 pytest.py _pytest testing
|
||||||
|
|
||||||
[testenv:py27-xdist]
|
[testenv:py27-xdist]
|
||||||
deps=pytest-xdist>=1.13
|
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_files=test_*.py *_test.py testing/*/*.py
|
||||||
python_classes=Test Acceptance
|
python_classes=Test Acceptance
|
||||||
python_functions=test
|
python_functions=test
|
||||||
pep8ignore = E401 E225 E261 E128 E124 E302
|
|
||||||
norecursedirs = .tox ja .hg cx_freeze_source
|
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
|
||||||
|
|
Loading…
Reference in New Issue