Skip to content

Commit 93306f6

Browse files
committed
Merge remote-tracking branch 'upstream/master' into features
2 parents c70efaa + 962aede commit 93306f6

29 files changed

+150
-35
lines changed

AUTHORS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ Henk-Jaap Wagenaar
7878
Hugo van Kemenade
7979
Hui Wang (coldnight)
8080
Ian Bicking
81+
Ian Lesperance
8182
Jaap Broekhuizen
8283
Jan Balster
8384
Janne Vanhala
@@ -178,6 +179,7 @@ Tom Dalton
178179
Tom Viner
179180
Trevor Bekolay
180181
Tyler Goodlet
182+
Tzu-ping Chung
181183
Vasily Kuznetsov
182184
Victor Uriarte
183185
Vidar T. Fauske

CHANGELOG.rst

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,43 @@
88
99
.. towncrier release notes start
1010
11+
Pytest 3.3.2 (2017-12-25)
12+
=========================
13+
14+
Bug Fixes
15+
---------
16+
17+
- pytester: ignore files used to obtain current user metadata in the fd leak
18+
detector. (`#2784 <https://github.com/pytest-dev/pytest/issues/2784>`_)
19+
20+
- Fix **memory leak** where objects returned by fixtures were never destructed
21+
by the garbage collector. (`#2981
22+
<https://github.com/pytest-dev/pytest/issues/2981>`_)
23+
24+
- Fix conversion of pyargs to filename to not convert symlinks on Python 2. (`#2985
25+
<https://github.com/pytest-dev/pytest/issues/2985>`_)
26+
27+
- ``PYTEST_DONT_REWRITE`` is now checked for plugins too rather than only for
28+
test modules. (`#2995 <https://github.com/pytest-dev/pytest/issues/2995>`_)
29+
30+
31+
Improved Documentation
32+
----------------------
33+
34+
- Add clarifying note about behavior of multiple parametrized arguments (`#3001
35+
<https://github.com/pytest-dev/pytest/issues/3001>`_)
36+
37+
38+
Trivial/Internal Changes
39+
------------------------
40+
41+
- Code cleanup. (`#3015 <https://github.com/pytest-dev/pytest/issues/3015>`_,
42+
`#3021 <https://github.com/pytest-dev/pytest/issues/3021>`_)
43+
44+
- Clean up code by replacing imports and references of `_ast` to `ast`. (`#3018
45+
<https://github.com/pytest-dev/pytest/issues/3018>`_)
46+
47+
1148
Pytest 3.3.1 (2017-12-05)
1249
=========================
1350

CONTRIBUTING.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,3 +276,15 @@ Here is a simple overview, with pytest-specific bits:
276276
base: features # if it's a feature
277277

278278

279+
Joining the Development Team
280+
----------------------------
281+
282+
Anyone who has successfully seen through a pull request which did not
283+
require any extra work from the development team to merge will
284+
themselves gain commit access if they so wish (if we forget to ask please send a friendly
285+
reminder). This does not mean your workflow to contribute changes,
286+
everyone goes through the same pull-request-and-review process and
287+
no-one merges their own pull requests unless already approved. It does however mean you can
288+
participate in the development process more fully since you can merge
289+
pull requests from other contributors yourself after having reviewed
290+
them.

_pytest/pytester.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@
2626
PYTEST_FULLPATH = os.path.abspath(pytest.__file__.rstrip("oc")).replace("$py.class", ".py")
2727

2828

29+
IGNORE_PAM = [ # filenames added when obtaining details about the current user
30+
u'/var/lib/sss/mc/passwd'
31+
]
32+
33+
2934
def pytest_addoption(parser):
3035
parser.addoption('--lsof',
3136
action="store_true", dest="lsof", default=False,
@@ -66,6 +71,8 @@ def isopen(line):
6671
fields = line.split('\0')
6772
fd = fields[0][1:]
6873
filename = fields[1][1:]
74+
if filename in IGNORE_PAM:
75+
continue
6976
if filename.startswith('/'):
7077
open_files.append((fd, filename))
7178

_pytest/python.py

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,17 @@
3030
from _pytest.outcomes import fail
3131
from _pytest.mark import transfer_markers
3232

33-
cutdir1 = py.path.local(pluggy.__file__.rstrip("oc"))
34-
cutdir2 = py.path.local(_pytest.__file__).dirpath()
35-
cutdir3 = py.path.local(py.__file__).dirpath()
33+
34+
# relative paths that we use to filter traceback entries from appearing to the user;
35+
# see filter_traceback
36+
# note: if we need to add more paths than what we have now we should probably use a list
37+
# for better maintenance
38+
_pluggy_dir = py.path.local(pluggy.__file__.rstrip("oc"))
39+
# pluggy is either a package or a single module depending on the version
40+
if _pluggy_dir.basename == '__init__.py':
41+
_pluggy_dir = _pluggy_dir.dirpath()
42+
_pytest_dir = py.path.local(_pytest.__file__).dirpath()
43+
_py_dir = py.path.local(py.__file__).dirpath()
3644

3745

3846
def filter_traceback(entry):
@@ -47,10 +55,10 @@ def filter_traceback(entry):
4755
is_generated = '<' in raw_filename and '>' in raw_filename
4856
if is_generated:
4957
return False
50-
# entry.path might point to an inexisting file, in which case it will
51-
# alsso return a str object. see #1133
58+
# entry.path might point to an non-existing file, in which case it will
59+
# also return a str object. see #1133
5260
p = py.path.local(entry.path)
53-
return p != cutdir1 and not p.relto(cutdir2) and not p.relto(cutdir3)
61+
return not p.relto(_pluggy_dir) and not p.relto(_pytest_dir) and not p.relto(_py_dir)
5462

5563

5664
def pyobj_property(name):
@@ -563,7 +571,6 @@ def _prunetraceback(self, excinfo):
563571
if ntraceback == traceback:
564572
ntraceback = ntraceback.cut(path=path)
565573
if ntraceback == traceback:
566-
# ntraceback = ntraceback.cut(excludepath=cutdir2)
567574
ntraceback = ntraceback.filter(filter_traceback)
568575
if not ntraceback:
569576
ntraceback = traceback

_pytest/skipping.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ def pytest_runtest_makereport(item, call):
261261
else:
262262
rep.outcome = "passed"
263263
rep.wasxfail = explanation
264-
elif item._skipped_by_mark and rep.skipped and type(rep.longrepr) is tuple:
264+
elif getattr(item, '_skipped_by_mark', False) and rep.skipped and type(rep.longrepr) is tuple:
265265
# skipped by mark.skipif; change the location of the failure
266266
# to point to the item definition, otherwise it will display
267267
# the location of where the skip exception was raised within pytest

changelog/2981.bugfix

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog/2985.bugfix

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog/2995.bugfix

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog/3015.trivial

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)