Skip to content

Commit c1b83cd

Browse files
author
Duncan Betts
committed
Add hint of Issue pytest-dev#478 to error text
1 parent 33796c8 commit c1b83cd

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

AUTHORS

+1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ David Mohr
4444
David Vierra
4545
Diego Russo
4646
Dmitry Dygalo
47+
Duncan Betts
4748
Edison Gustavo Muenz
4849
Edoardo Batini
4950
Eduardo Schettino

CHANGELOG.rst

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
3.0.5.dev0
22
==========
33

4-
*
4+
* Add hint to error message hinting possible missing __init__.py (`#478`_). Thanks `@DuncanBetts`_.
55

66
* An error message is now displayed if ``--confcutdir`` is not a valid directory, avoiding
77
subtle bugs (`#2078`_).
@@ -20,8 +20,10 @@
2020
*
2121

2222
.. _@adler-j: https://github.com/adler-j
23+
.. _@DuncanBetts: https://github.com/DuncanBetts
2324
.. _@nedbat: https://github.com/nedbat
2425

26+
.. _#478: https://github.com/pytest-dev/pytest/issues/478
2527
.. _#2038: https://github.com/pytest-dev/pytest/issues/2038
2628
.. _#2078: https://github.com/pytest-dev/pytest/issues/2078
2729
.. _#2082: https://github.com/pytest-dev/pytest/issues/2082

_pytest/main.py

+2-3
Original file line numberDiff line numberDiff line change
@@ -704,10 +704,9 @@ def _parsearg(self, arg):
704704
path = self.config.invocation_dir.join(relpath, abs=True)
705705
if not path.check():
706706
if self.config.option.pyargs:
707-
msg = "file or package not found: "
707+
raise pytest.UsageError("file or package not found: " + arg + " (missing __init__.py?)")
708708
else:
709-
msg = "file not found: "
710-
raise pytest.UsageError(msg + arg)
709+
raise pytest.UsageError("file not found: " + arg)
711710
parts[0] = path
712711
return parts
713712

0 commit comments

Comments
 (0)