Skip to content

Commit d05d19d

Browse files
authored
Merge pull request #2085 from DuncanBetts/master
Add hint of Issue #478 to error text
2 parents fa4d5da + c1b83cd commit d05d19d

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

AUTHORS

Lines changed: 1 addition & 0 deletions
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

Lines changed: 3 additions & 1 deletion
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

Lines changed: 2 additions & 3 deletions
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)