Merge pull request #166246 from SuperSandro2000/remove-usage-pytest-black

This commit is contained in:
Sandro 2022-03-29 16:32:31 +02:00 committed by GitHub
commit f24d3eba64
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 6 additions and 41 deletions

View File

@ -3,10 +3,7 @@
, fetchPypi
, setuptools-scm
, isPy3k
, pytest
, pytest-black
, pytest-flake8
, pytest-cov
, pytestCheckHook
}:
buildPythonPackage rec {
@ -20,12 +17,7 @@ buildPythonPackage rec {
nativeBuildInputs = [ setuptools-scm ];
checkInputs = [ pytest pytest-flake8 pytest-black pytest-cov ];
# ironically, they fail a linting test, and pytest.ini forces that test suite
checkPhase = ''
rm backports/functools_lru_cache.py
pytest -k 'not format'
'';
checkInputs = [ pytestCheckHook ];
# Test fail on Python 2
doCheck = isPy3k;

View File

@ -1,13 +0,0 @@
diff --git a/test_portend.py b/test_portend.py
index b2de8c2..3f90276 100644
--- a/test_portend.py
+++ b/test_portend.py
@@ -21,7 +21,7 @@ def socket_infos():
def id_for_info(info):
- af, = info[:1]
+ (af,) = info[:1]
return str(af)

View File

@ -1,5 +1,5 @@
{ lib, buildPythonPackage, fetchPypi
, pytest, setuptools-scm, tempora, pytest-black, pytest-cov }:
, pytestCheckHook, setuptools-scm, tempora }:
buildPythonPackage rec {
pname = "portend";
@ -10,19 +10,11 @@ buildPythonPackage rec {
sha256 = "239e3116045ea823f6df87d6168107ad75ccc0590e37242af0cc1e98c5d224e4";
};
postPatch = ''
substituteInPlace pytest.ini --replace "--flake8" ""
'';
nativeBuildInputs = [ setuptools-scm ];
propagatedBuildInputs = [ tempora ];
checkInputs = [ pytest pytest-black pytest-cov ];
checkPhase = ''
py.test --deselect=test_portend.py::TestChecker::test_check_port_listening
'';
checkInputs = [ pytestCheckHook ];
# Some of the tests use localhost networking.
__darwinAllowLocalNetworking = true;

View File

@ -1,7 +1,6 @@
{ lib, buildPythonPackage, fetchPypi
, setuptools-scm, pytest, pytest-freezegun, freezegun, backports_unittest-mock
, setuptools-scm, pytestCheckHook, pytest-freezegun, freezegun, backports_unittest-mock
, six, pytz, jaraco_functools, pythonOlder
, pytest-flake8, pytest-cov, pytest-black, pytest-mypy
}:
buildPythonPackage rec {
@ -20,14 +19,9 @@ buildPythonPackage rec {
propagatedBuildInputs = [ six pytz jaraco_functools ];
checkInputs = [
pytest-freezegun pytest freezegun backports_unittest-mock
pytest-flake8 pytest-cov pytest-black pytest-mypy
pytest-freezegun pytestCheckHook freezegun backports_unittest-mock
];
checkPhase = ''
pytest
'';
meta = with lib; {
description = "Objects and routines pertaining to date and time";
homepage = "https://github.com/jaraco/tempora";