Skip to content

Commit 0735d45

Browse files
authored
Merge pull request #2088 from nmundar/issue-2034
Issue 2034
2 parents f25ba4d + 2d71979 commit 0735d45

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

AUTHORS

+1
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,7 @@ Michael Droettboom
104104
Michael Seifert
105105
Mike Lundy
106106
Ned Batchelder
107+
Neven Mundar
107108
Nicolas Delaby
108109
Oleg Pidsadnyi
109110
Oliver Bestwalter

CHANGELOG.rst

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

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

66
* Provide ``:ref:`` targets for ``recwarn.rst`` so we can use intersphinx referencing.
77
Thanks to `@dupuy`_ for the report and `@lwm`_ for the PR.
88

9+
* Using ``item.Function``, ``item.Module``, etc., is now issuing deprecation warnings, prefer
10+
``pytest.Function``, ``pytest.Module``, etc., instead (`#2034`_).
11+
Thanks `@nmundar`_ for the PR.
12+
913
* An error message is now displayed if ``--confcutdir`` is not a valid directory, avoiding
1014
subtle bugs (`#2078`_).
1115
Thanks `@nicoddemus`_ for the PR.
@@ -27,8 +31,10 @@
2731
.. _@adler-j: https://github.com/adler-j
2832
.. _@DuncanBetts: https://github.com/DuncanBetts
2933
.. _@nedbat: https://github.com/nedbat
34+
.. _@nmundar: https://github.com/nmundar
3035

3136
.. _#478: https://github.com/pytest-dev/pytest/issues/478
37+
.. _#2034: https://github.com/pytest-dev/pytest/issues/2034
3238
.. _#2038: https://github.com/pytest-dev/pytest/issues/2038
3339
.. _#2078: https://github.com/pytest-dev/pytest/issues/2078
3440
.. _#2082: https://github.com/pytest-dev/pytest/issues/2082

_pytest/main.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,9 @@ def __getattr__(self, name):
190190

191191
def compatproperty(name):
192192
def fget(self):
193-
# deprecated - use pytest.name
193+
import warnings
194+
warnings.warn("This usage is deprecated, please use pytest.{0} instead".format(name),
195+
PendingDeprecationWarning, stacklevel=2)
194196
return getattr(pytest, name)
195197

196198
return property(fget)

0 commit comments

Comments
 (0)