python312Packages.lockfile: Remove usage of nose; modernize (#343765)
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
fetchPypi,
|
||||
setuptools,
|
||||
pbr,
|
||||
nose,
|
||||
pytestCheckHook,
|
||||
}:
|
||||
|
||||
buildPythonPackage rec {
|
||||
@@ -14,25 +14,21 @@ buildPythonPackage rec {
|
||||
|
||||
src = fetchPypi {
|
||||
inherit pname version;
|
||||
sha256 = "6aed02de03cba24efabcd600b30540140634fc06cfa603822d508d5361e9f799";
|
||||
hash = "sha256-au0C3gPLok76vNYAswVAFAY0/AbPpgOCLVCNU2Hp95k=";
|
||||
};
|
||||
|
||||
patches = [ ./fix-tests.patch ];
|
||||
|
||||
build-system = [
|
||||
pbr
|
||||
setuptools
|
||||
];
|
||||
|
||||
nativeCheckInputs = [ nose ];
|
||||
nativeCheckInputs = [ pytestCheckHook ];
|
||||
|
||||
checkPhase = ''
|
||||
runHook preCheck
|
||||
nosetests
|
||||
runHook postcheck
|
||||
'';
|
||||
|
||||
meta = with lib; {
|
||||
meta = {
|
||||
homepage = "https://launchpad.net/pylockfile";
|
||||
description = "Platform-independent advisory file locking capability for Python applications";
|
||||
license = licenses.asl20;
|
||||
license = lib.licenses.asl20;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
diff --git a/test/compliancetest.py b/test/compliancetest.py
|
||||
index bf4e59c..f55e258 100644
|
||||
--- a/test/compliancetest.py
|
||||
+++ b/test/compliancetest.py
|
||||
@@ -6,18 +6,19 @@ import lockfile
|
||||
|
||||
|
||||
class ComplianceTest(object):
|
||||
- def __init__(self):
|
||||
- self.saved_class = lockfile.LockFile
|
||||
+ @classmethod
|
||||
+ def setup_class(cls):
|
||||
+ cls.saved_class = lockfile.LockFile
|
||||
|
||||
def _testfile(self):
|
||||
"""Return platform-appropriate file. Helper for tests."""
|
||||
import tempfile
|
||||
return os.path.join(tempfile.gettempdir(), 'trash-%s' % os.getpid())
|
||||
|
||||
- def setup(self):
|
||||
+ def setup_method(self):
|
||||
lockfile.LockFile = self.class_to_test
|
||||
|
||||
- def teardown(self):
|
||||
+ def teardown_method(self):
|
||||
try:
|
||||
tf = self._testfile()
|
||||
if os.path.isdir(tf):
|
||||
Reference in New Issue
Block a user