fix error reporting issue when a "pyc" file has no relating "py"
This commit is contained in:
parent
adacd3491d
commit
762ea71f67
|
@ -449,7 +449,7 @@ class Session(FSCollector):
|
||||||
p = p.dirpath()
|
p = p.dirpath()
|
||||||
else:
|
else:
|
||||||
p = p.new(basename=p.purebasename+".py")
|
p = p.new(basename=p.purebasename+".py")
|
||||||
return p
|
return str(p)
|
||||||
|
|
||||||
def _parsearg(self, arg):
|
def _parsearg(self, arg):
|
||||||
""" return (fspath, names) tuple after checking the file exists. """
|
""" return (fspath, names) tuple after checking the file exists. """
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
"""
|
"""
|
||||||
unit and functional testing with Python.
|
unit and functional testing with Python.
|
||||||
"""
|
"""
|
||||||
__version__ = '2.0.1.dev9'
|
__version__ = '2.0.1.dev10'
|
||||||
__all__ = ['main']
|
__all__ = ['main']
|
||||||
|
|
||||||
from _pytest.core import main, UsageError, _preloadplugins
|
from _pytest.core import main, UsageError, _preloadplugins
|
||||||
|
|
4
setup.py
4
setup.py
|
@ -22,7 +22,7 @@ def main():
|
||||||
name='pytest',
|
name='pytest',
|
||||||
description='py.test: simple powerful testing with Python',
|
description='py.test: simple powerful testing with Python',
|
||||||
long_description = long_description,
|
long_description = long_description,
|
||||||
version='2.0.1.dev9',
|
version='2.0.1.dev10',
|
||||||
url='http://pytest.org',
|
url='http://pytest.org',
|
||||||
license='MIT license',
|
license='MIT license',
|
||||||
platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'],
|
platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'],
|
||||||
|
@ -67,4 +67,4 @@ def make_entry_points():
|
||||||
return {'console_scripts': l}
|
return {'console_scripts': l}
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
main()
|
main()
|
|
@ -346,6 +346,12 @@ class TestInvocationVariants:
|
||||||
result.stdout.fnmatch_lines([
|
result.stdout.fnmatch_lines([
|
||||||
"*2 passed*"
|
"*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):
|
def test_cmdline_python_package_not_exists(self, testdir):
|
||||||
result = testdir.runpytest("--pyargs", "tpkgwhatv")
|
result = testdir.runpytest("--pyargs", "tpkgwhatv")
|
||||||
|
|
Loading…
Reference in New Issue