Skip to content

Commit

Permalink
Merge pull request #2085 from DuncanBetts/master
Browse files Browse the repository at this point in the history
Add hint of Issue #478 to error text
  • Loading branch information
nicoddemus authored Nov 26, 2016
2 parents fa4d5da + c1b83cd commit d05d19d
Showing 3 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
@@ -44,6 +44,7 @@ David Mohr
David Vierra
Diego Russo
Dmitry Dygalo
Duncan Betts
Edison Gustavo Muenz
Edoardo Batini
Eduardo Schettino
4 changes: 3 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
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
subtle bugs (`#2078`_).
@@ -20,8 +20,10 @@
*

.. _@adler-j: https://github.com/adler-j
.. _@DuncanBetts: https://github.com/DuncanBetts
.. _@nedbat: https://github.com/nedbat

.. _#478: https://github.com/pytest-dev/pytest/issues/478
.. _#2038: https://github.com/pytest-dev/pytest/issues/2038
.. _#2078: https://github.com/pytest-dev/pytest/issues/2078
.. _#2082: https://github.com/pytest-dev/pytest/issues/2082
5 changes: 2 additions & 3 deletions _pytest/main.py
Original file line number Diff line number Diff line change
@@ -704,10 +704,9 @@ def _parsearg(self, arg):
path = self.config.invocation_dir.join(relpath, abs=True)
if not path.check():
if self.config.option.pyargs:
msg = "file or package not found: "
raise pytest.UsageError("file or package not found: " + arg + " (missing __init__.py?)")
else:
msg = "file not found: "
raise pytest.UsageError(msg + arg)
raise pytest.UsageError("file not found: " + arg)
parts[0] = path
return parts

0 comments on commit d05d19d

Please sign in to comment.