Unverified Commit c477a486 authored by Peder Bergebakken Sundt's avatar Peder Bergebakken Sundt Committed by GitHub
Browse files

treewide: replace all pytest-cov patching outside of pythonPackages with pytest-cov-stub (#336777)

parents a4ac0cd8 c783e2b3
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -47,7 +47,7 @@ python311Packages.buildPythonApplication rec {
    minimock
    pytest
    pytest-httpserver
    pytest-cov
    pytest-cov-stub
  ];

  doCheck = true;
+2 −5
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@
, proton-vpn-session
, pycairo
, pygobject3
, pytest-cov-stub
, pytestCheckHook
, withIndicator ? true
, libappindicator-gtk3
@@ -69,11 +70,6 @@ buildPythonApplication rec {
    pygobject3
  ];

  postPatch = ''
    substituteInPlace setup.cfg \
      --replace-fail "--cov=proton --cov-report=html --cov-report=term" ""
  '';

  postInstall = ''
    mkdir -p $out/share/{applications,pixmaps}
    install -Dm 644 ${src}/rpmbuild/SOURCES/protonvpn-app.desktop $out/share/applications
@@ -81,6 +77,7 @@ buildPythonApplication rec {
  '';

  nativeCheckInputs = [
    pytest-cov-stub
    pytestCheckHook
  ];

+1 −4
Original line number Diff line number Diff line
@@ -219,6 +219,7 @@ python.pkgs.buildPythonApplication rec {
    daphne
    factory-boy
    imagehash
    pytest-cov-stub
    pytest-django
    pytest-env
    pytest-httpx
@@ -240,10 +241,6 @@ python.pkgs.buildPythonApplication rec {
    export PATH="${path}:$PATH"
    export HOME=$(mktemp -d)
    export XDG_DATA_DIRS="${liberation_ttf}/share:$XDG_DATA_DIRS"

    # Disable unneeded code coverage test
    substituteInPlace src/setup.cfg \
      --replace-fail "--cov --cov-report=html --cov-report=xml" ""
  '';

  disabledTests = [
+2 −1
Original line number Diff line number Diff line
@@ -3,6 +3,7 @@
, fetchFromGitHub
, git
, pytestCheckHook
, pytest-cov-stub
, pytest-mock
}:

@@ -28,7 +29,6 @@ buildPythonApplication rec {
      --replace pytest==5.2.2 pytest \
      --replace pytest-cov==2.8.1 "" \
      --replace pytest-mock==1.11.2 pytest-mock \
      --replace "--cov=git_archive_all --cov-report=term --cov-branch" "" \
      --replace "filterwarnings = error" ""
    substituteInPlace test_git_archive_all.py \
      --replace "import pycodestyle" ""
@@ -40,6 +40,7 @@ buildPythonApplication rec {

  checkInputs = [
    pytestCheckHook
    pytest-cov-stub
    pytest-mock
  ];

+1 −5
Original line number Diff line number Diff line
@@ -17,11 +17,6 @@ python3.pkgs.buildPythonApplication rec {
    hash = "sha256-AJ0ZWRxqhBJEics6XnIVWyf7pJI8MphQU4LRqSYYNSQ=";
  };

  postPatch = ''
    substituteInPlace setup.cfg \
      --replace-fail '--cov-config=setup.cfg' ""
  '';

  dependencies = with python3.pkgs; [
    dbus-python
    icalendar
@@ -40,6 +35,7 @@ python3.pkgs.buildPythonApplication rec {
  nativeCheckInputs = with python3.pkgs; [
    dbus
    freezegun
    pytest-cov-stub
    pytest-datadir
    pytest-httpserver
    pytest-mock
Loading