[py-svn] commit/pytest-codecheckers: RonnyPfannschmidt: fix tests and code
Bitbucket
commits-noreply at bitbucket.org
Mon Jan 23 15:40:38 CET 2012
1 new commit in pytest-codecheckers:
https://bitbucket.org/RonnyPfannschmidt/pytest-codecheckers/changeset/d6c8e1d69203/
changeset: d6c8e1d69203
user: RonnyPfannschmidt
date: 2012-01-23 15:40:28
summary: fix tests and code
affected #: 2 files
diff -r 35e51c4a7984854221ba2961968c984023ddd904 -r d6c8e1d69203d17b231164b8b2923c9b79a044ba codecheckers/plugin.py
--- a/codecheckers/plugin.py
+++ b/codecheckers/plugin.py
@@ -40,8 +40,9 @@
return []
checkers = self.config.getini('codechecks')
entrypoints = pkg_resources.iter_entry_points('codechecker')
- #XXX: list wanted checkers we didnt get
- return [PyCodeCheckItem(ep, self) for ep in entrypoints if ep.name in checkers]
+
+ items = [PyCodeCheckItem(ep, self) for ep in entrypoints if ep.name in checkers]
+ return items
def pytest_collect_file(path, parent):
diff -r 35e51c4a7984854221ba2961968c984023ddd904 -r d6c8e1d69203d17b231164b8b2923c9b79a044ba tests/test_pyflakes.py
--- a/tests/test_pyflakes.py
+++ b/tests/test_pyflakes.py
@@ -1,25 +1,30 @@
+def pytest_funcarg__testdir(request):
+ testdir = request.getfuncargvalue('testdir')
+ testdir.makeini('[pytest]\ncodechecks = pyflakes')
+ return testdir
+
+
def test_pyflakes_finds_name_error(testdir):
- f = testdir.makepyfile('''
+ testdir.makepyfile('''
def tesdt_a():
pass
def b():
abc
''')
#XXX: bad hack cause i fail to disable the pep8 checker
- f.write(f.read() + '\n')
- out = testdir.runpytest('--tb=short', '--codecheck=pyflakes', '-k', 'flakes', '-v')
+ out = testdir.runpytest('--tb=short', '-k', 'flakes', '-v')
out.stdout.fnmatch_lines([
'*abc*',
'*1 failed*',
])
+
def test_reportinfo_verbose(testdir):
- f = testdir.makepyfile('''
+ testdir.makepyfile('''
def xyz():
pass
''')
- f.write(f.read() + '\n')
- out = testdir.runpytest('-v', '--codecheck=pyflakes')
+ out = testdir.runpytest('-v')
out.stdout.fnmatch_lines([
- '*test_reportinfo_verbose.py: codecheck pyflakes PASSED',
+ '*test_reportinfo_verbose.py:0: codecheck pyflakes PASSED',
])
Repository URL: https://bitbucket.org/RonnyPfannschmidt/pytest-codecheckers/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
More information about the pytest-commit
mailing list