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

Upgrade pytest to 3.5.1

    XMLWordPrintable

    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

            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.
            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

              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:

                  Jenkins

                  No builds found.