Skip to content

[prerelease] deselected addition to assert_outcomes() is backwards-incompatible #9471

@The-Compiler

Description

@The-Compiler

#9133 added a new deselected parameter to assert_outcomes(), cc @okken.

However, this actually is an incompatible change: Doing e.g. result = testdir.runpytest("-k", "test_not_found_by_ini") followed by result.assert_outcomes(passed=2) worked fine before, but now fails because the now included 'deselected': ... does not equal 'deselected': 0.

This breaks pytest-bdd: pytest-dev/pytest-bdd#466 - I could swear I also saw another project in #9415 fail after fixing the initial issue it had, but then Christmas and stuff came along and now I don't remember which one it was, and of course can't find it anymore.

A (quite) rough search reveals that more projects might be affected by this (excludes to avoid matches in copies of pytest's source code).

Some examples I could dig up (but haven't verified):

I think the change in itself makes sense, but at the same time fixes like pytest-dev/pytest-bdd#470 are a bit cumbersome.

Two questions:

  • What should we do about this for 7.0? (even if the answer just is "live with it and document it as backwards-incompatible in the changelog)
  • What (if anything) should we do about this so that it doesn't happen again for future releases? I guess not much we can do, as long as we want to assume 0 for outcomes which have not been given...

Metadata

Metadata

Assignees

No one assigned

    Labels

    plugin: pytesterrelated to the pytester builtin plugintype: backward compatibilitymight present some backward compatibility issues which should be carefully noted in the changelog

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions