Add hint of Issue #478 to error text

This commit is contained in:
Duncan Betts 2016-11-26 10:47:15 +00:00
parent 33796c8a13
commit c1b83cdeea
3 changed files with 6 additions and 4 deletions

View File

@ -44,6 +44,7 @@ David Mohr
David Vierra David Vierra
Diego Russo Diego Russo
Dmitry Dygalo Dmitry Dygalo
Duncan Betts
Edison Gustavo Muenz Edison Gustavo Muenz
Edoardo Batini Edoardo Batini
Eduardo Schettino Eduardo Schettino

View File

@ -1,7 +1,7 @@
3.0.5.dev0 3.0.5.dev0
========== ==========
* * Add hint to error message hinting possible missing __init__.py (`#478`_). Thanks `@DuncanBetts`_.
* An error message is now displayed if ``--confcutdir`` is not a valid directory, avoiding * An error message is now displayed if ``--confcutdir`` is not a valid directory, avoiding
subtle bugs (`#2078`_). subtle bugs (`#2078`_).
@ -20,8 +20,10 @@
* *
.. _@adler-j: https://github.com/adler-j .. _@adler-j: https://github.com/adler-j
.. _@DuncanBetts: https://github.com/DuncanBetts
.. _@nedbat: https://github.com/nedbat .. _@nedbat: https://github.com/nedbat
.. _#478: https://github.com/pytest-dev/pytest/issues/478
.. _#2038: https://github.com/pytest-dev/pytest/issues/2038 .. _#2038: https://github.com/pytest-dev/pytest/issues/2038
.. _#2078: https://github.com/pytest-dev/pytest/issues/2078 .. _#2078: https://github.com/pytest-dev/pytest/issues/2078
.. _#2082: https://github.com/pytest-dev/pytest/issues/2082 .. _#2082: https://github.com/pytest-dev/pytest/issues/2082

View File

@ -704,10 +704,9 @@ class Session(FSCollector):
path = self.config.invocation_dir.join(relpath, abs=True) path = self.config.invocation_dir.join(relpath, abs=True)
if not path.check(): if not path.check():
if self.config.option.pyargs: if self.config.option.pyargs:
msg = "file or package not found: " raise pytest.UsageError("file or package not found: " + arg + " (missing __init__.py?)")
else: else:
msg = "file not found: " raise pytest.UsageError("file not found: " + arg)
raise pytest.UsageError(msg + arg)
parts[0] = path parts[0] = path
return parts return parts