anchor.diff:  { lib, buildPythonPackage, pythonOlder, fetchPypi, isPy3k, isPyPy
  -, pythonAtLeast, fetchpatch
   , atomicwrites
   , attrs
   , hypothesis
  
positive.code: , setuptools
  , setuptools-scm
  , six
  , toml
  , wcwidth
  , writeText
  }:
  
  buildPythonPackage rec {
    pname = "pytest";
    version = "6.2.5";
    disabled = !isPy3k;
  
    src = fetchPypi {
      inherit pname version;
      sha256 = "131b36680866a76e6781d13f101efb86cf674ebb9762eb70d3082b6f29889e89";
    };
  
    patches = lib.optionals (pythonAtLeast "3.10") [
      (fetchpatch {
        # Fix test_errors_in_xfail_skip_expressions for Python 3.10.1, remove after 6.2.5
        url = "https://github.com/pytest-dev/pytest/commit/913439f5e5691f391e2969b3c8f0a49e50dce43a.patch";
        sha256 = "0hsl3lww6bx5k99cp8gj0fy9rg02kcfbwiiwjx2y8vbhwd5ns41p";
      })
    ];
  
    nativeBuildInputs = [ setuptools-scm ];
  
  
negative.code:     # - files are not needed after tests are finished
      pytestRemoveBytecodePhase () {
          # suffix is defined at:
          #    https://github.com/pytest-dev/pytest/blob/7.0.1/src/_pytest/assertion/rewrite.py#L51-L53
          find $out -name "*-pytest-*.py[co]" -delete
      }
      preDistPhases+=" pytestRemoveBytecodePhase"
  