Skip to content

Commit

Permalink
python312Packages.lockfile: Remove usage of nose
Browse files Browse the repository at this point in the history
  • Loading branch information
pyrox0 committed Sep 22, 2024
1 parent d76fe5b commit c9f9617
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 8 deletions.
12 changes: 4 additions & 8 deletions pkgs/development/python-modules/lockfile/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
fetchPypi,
setuptools,
pbr,
nose,
pytestCheckHook,
}:

buildPythonPackage rec {
Expand All @@ -17,18 +17,14 @@ buildPythonPackage rec {
sha256 = "6aed02de03cba24efabcd600b30540140634fc06cfa603822d508d5361e9f799";
};

patches = [ ./fix-tests.patch ];

build-system = [
pbr
setuptools
];

nativeCheckInputs = [ nose ];

checkPhase = ''
runHook preCheck
nosetests
runHook postcheck
'';
nativeCheckInputs = [ pytestCheckHook ];

meta = with lib; {
homepage = "https://launchpad.net/pylockfile";
Expand Down
28 changes: 28 additions & 0 deletions pkgs/development/python-modules/lockfile/fix-tests.patch
Original file line number Diff line number Diff line change
@@ -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):

0 comments on commit c9f9617

Please sign in to comment.