diff --git a/_pytest/main.py b/_pytest/main.py index f1be30601..23775347b 100644 --- a/_pytest/main.py +++ b/_pytest/main.py @@ -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. """ diff --git a/pytest.py b/pytest.py index fe55b153f..197794047 100644 --- a/pytest.py +++ b/pytest.py @@ -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 diff --git a/setup.py b/setup.py index 018a5a308..ad82d081f 100644 --- a/setup.py +++ b/setup.py @@ -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() \ No newline at end of file diff --git a/testing/acceptance_test.py b/testing/acceptance_test.py index a53afe7fc..a82f42f4a 100644 --- a/testing/acceptance_test.py +++ b/testing/acceptance_test.py @@ -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")