fix error reporting issue when a "pyc" file has no relating "py"

This commit is contained in:
holger krekel 2011-01-27 21:11:21 +01:00
parent adacd3491d
commit 762ea71f67
4 changed files with 10 additions and 4 deletions

View File

@ -449,7 +449,7 @@ class Session(FSCollector):
p = p.dirpath()
else:
p = p.new(basename=p.purebasename+".py")
return p
return str(p)
def _parsearg(self, arg):
""" return (fspath, names) tuple after checking the file exists. """

View File

@ -1,7 +1,7 @@
"""
unit and functional testing with Python.
"""
__version__ = '2.0.1.dev9'
__version__ = '2.0.1.dev10'
__all__ = ['main']
from _pytest.core import main, UsageError, _preloadplugins

View File

@ -22,7 +22,7 @@ def main():
name='pytest',
description='py.test: simple powerful testing with Python',
long_description = long_description,
version='2.0.1.dev9',
version='2.0.1.dev10',
url='http://pytest.org',
license='MIT license',
platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'],
@ -67,4 +67,4 @@ def make_entry_points():
return {'console_scripts': l}
if __name__ == '__main__':
main()
main()

View File

@ -346,6 +346,12 @@ class TestInvocationVariants:
result.stdout.fnmatch_lines([
"*2 passed*"
])
path.join('test_hello.py').remove()
result = testdir.runpytest("--pyargs", "tpkg.test_hello")
assert result.ret != 0
result.stderr.fnmatch_lines([
"*file*not*found*test_hello.py",
])
def test_cmdline_python_package_not_exists(self, testdir):
result = testdir.runpytest("--pyargs", "tpkgwhatv")