Skip to content

Commit ea6191a

Browse files
authored
Merge pull request #1779 from RonnyPfannschmidt/deselect-no-reason
terminal: dont pretend to know the deselection reason
2 parents 9540106 + 1c8fe96 commit ea6191a

File tree

3 files changed

+8
-12
lines changed

3 files changed

+8
-12
lines changed

CHANGELOG.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,10 @@ time or change existing behaviors in order to make them less surprising/more use
259259

260260
* Add stderr write for ``pytest.exit(msg)`` during startup. Previously the message was never shown.
261261
Thanks `@BeyondEvil`_ for reporting `#1210`_. Thanks to `@JonathonSonesen`_ and
262-
`@tomviner`_ for PR.
262+
`@tomviner`_ for the PR.
263+
264+
* fix `#1372`_ no longer display the incorrect test deselection reason,
265+
thanks `@ronnypfannschmidt`_ for the PR.
263266

264267
*
265268

@@ -311,6 +314,7 @@ time or change existing behaviors in order to make them less surprising/more use
311314
.. _#1210: https://github.com/pytest-dev/pytest/issues/1210
312315
.. _#1235: https://github.com/pytest-dev/pytest/issues/1235
313316
.. _#1351: https://github.com/pytest-dev/pytest/issues/1351
317+
.. _#1372: https://github.com/pytest-dev/pytest/issues/1372
314318
.. _#1421: https://github.com/pytest-dev/pytest/issues/1421
315319
.. _#1426: https://github.com/pytest-dev/pytest/issues/1426
316320
.. _#1428: https://github.com/pytest-dev/pytest/pull/1428

_pytest/terminal.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -512,16 +512,8 @@ def summary_stats(self):
512512

513513
def summary_deselected(self):
514514
if 'deselected' in self.stats:
515-
l = []
516-
k = self.config.option.keyword
517-
if k:
518-
l.append("-k%s" % k)
519-
m = self.config.option.markexpr
520-
if m:
521-
l.append("-m %r" % m)
522-
if l:
523-
self.write_sep("=", "%d tests deselected by %r" % (
524-
len(self.stats['deselected']), " ".join(l)), bold=True)
515+
self.write_sep("=", "%d tests deselected" % (
516+
len(self.stats['deselected'])), bold=True)
525517

526518
def repr_pythonversion(v=None):
527519
if v is None:

testing/test_terminal.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ def test_three():
384384
result = testdir.runpytest("-k", "test_two:", testpath)
385385
result.stdout.fnmatch_lines([
386386
"*test_deselected.py ..",
387-
"=* 1 test*deselected by*test_two:*=",
387+
"=* 1 test*deselected *=",
388388
])
389389
assert result.ret == 0
390390

0 commit comments

Comments
 (0)