Uploaded image for project: 'Request For Comments'
  1. Request For Comments
  2. RFC-481

Upgrade pytest to 3.5.1

    Details

    • Type: RFC
    • Status: Implemented
    • Resolution: Done
    • Component/s: DM
    • Labels:
      None

      Description

      In order to address aid in addressing issues in DM-11693 (namely rerunning passed tests at scons install time), we need to first upgrade to a the 3.5 minor release of pytest, which supports the --lfnf= flag.

       

      A list of deprecations and removals since our current version of pytest (3.2.0) that are relevant to our python version (3.6) is provided below. It's not likely any of these affect us, since we are mostly using pytest to run tests only.

      • pytest.approx no longer supports >, >=, < and <= operators to avoid surprising/inconsistent behavior. See the approx docs for more information. (#2003)
      • A deprecation warning is now raised when using marks for parameters in pytest.mark.parametrize. Use pytest.param to apply marks to parameters instead. (#2427)
      • Remove internal _preloadplugins() function. This removal is part of the pytest_namespace() hook deprecation. (#2636)
      • Internally change CallSpec2 to have a list of marks instead of a broken mapping of keywords. This removes the keywords attribute of the internal CallSpec2 class. (#2672)
      • The params list passed to pytest.fixture is now for all effects considered immutable and frozen at the moment of the pytest.fixture call. Previously the list could be changed before the first invocation of the fixture allowing for a form of dynamic parametrization (for example, updated from command-line options), but this was an unwanted implementation detail which complicated the internals and prevented some internal cleanup. See issue #2959 for details and a recommended workaround.
      • All pytest classes now subclass object for better Python 2/3 compatibility. This should not affect user code except in very rare edge cases. (#2147)
      • record_xml_property fixture is now deprecated in favor of the more generic record_property. (#2770)
      • Defining pytest_plugins is now deprecated in non-top-level conftest.py files, because they “leak” to the entire directory tree. (#3084)

        Attachments

          Issue Links

            Activity

            bvan Brian Van Klaveren created issue -
            bvan Brian Van Klaveren made changes -
            Field Original Value New Value
            Link This issue relates to DM-11693 [ DM-11693 ]
            bvan Brian Van Klaveren made changes -
            Risk Score 0
            Hide
            tjenness Tim Jenness added a comment - - edited

            This sounds good to me, but can we please take this opportunity to refresh all the testing classes. We need an updated pep8-naming and it's always good to keep up to date with pycodestyle and the like so we don't get weird inconsistencies when people update their conda versions, or travis runs on a package with a much newer flake8.

            Show
            tjenness Tim Jenness added a comment - - edited This sounds good to me, but can we please take this opportunity to refresh all the testing classes. We need an updated pep8-naming and it's always good to keep up to date with pycodestyle and the like so we don't get weird inconsistencies when people update their conda versions, or travis runs on a package with a much newer flake8.
            Hide
            tjenness Tim Jenness added a comment -

            Brian Van Klaveren I see no objections so please adopt. A new pep8-naming was released at the start of May.

            Show
            tjenness Tim Jenness added a comment - Brian Van Klaveren I see no objections so please adopt. A new pep8-naming was released at the start of May.
            bvan Brian Van Klaveren made changes -
            Status Proposed [ 10805 ] Adopted [ 10806 ]
            Hide
            rowen Russell Owen added a comment -

            I'm all in favor. However, one small warning: pytest 3.5 uses .pytest_cache as a cache instead of .cache. I have been adding the former to .gitignore files as I edit packages on other tickets, but there are still many packages left to convert and folks will see git status clutter until the change is made.

            Show
            rowen Russell Owen added a comment - I'm all in favor. However, one small warning: pytest 3.5 uses .pytest_cache as a cache instead of .cache . I have been adding the former to .gitignore files as I edit packages on other tickets, but there are still many packages left to convert and folks will see git status clutter until the change is made.
            Hide
            bvan Brian Van Klaveren added a comment -

            Thanks Russell Owen, I'll see what repos I need to fix

            Show
            bvan Brian Van Klaveren added a comment - Thanks Russell Owen , I'll see what repos I need to fix
            Parejkoj John Parejko made changes -
            Link This issue is triggering DM-14589 [ DM-14589 ]
            ktl Kian-Tat Lim made changes -
            Link This issue is triggering DM-15701 [ DM-15701 ]
            bvan Brian Van Klaveren made changes -
            Resolution Done [ 10000 ]
            Status Adopted [ 10806 ] Implemented [ 11105 ]

              People

              • Assignee:
                bvan Brian Van Klaveren
                Reporter:
                bvan Brian Van Klaveren
                Watchers:
                Brian Van Klaveren, Heather Kelly, John Swinbank, Russell Owen, Tim Jenness
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Planned End:

                  Summary Panel