From bed1b63e69b38baa25caf1ebc40571f57d8b759b Mon Sep 17 00:00:00 2001
From: Carl George <carl@george.computer>
Date: Wed, 9 Feb 2022 17:31:27 -0600
Subject: [PATCH] Switch from nose to pytest
This is not a full rewrite to pytest style tests, it just changes the
minimum to allow pytest to run the existing tests.
---
gitdb/test/db/test_pack.py | 4 ++--
gitdb/test/lib.py | 4 ++--
gitdb/test/test_pack.py | 4 ++--
3 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/gitdb/test/db/test_pack.py b/gitdb/test/db/test_pack.py
index 458d804..7959442 100644
--- a/gitdb/test/db/test_pack.py
+++ b/gitdb/test/db/test_pack.py
@@ -16,7 +16,7 @@ import os
import random
import sys
-from nose.plugins.skip import SkipTest
+import pytest
class TestPackDB(TestDBBase):
@@ -24,7 +24,7 @@ class TestPackDB(TestDBBase):
@with_packs_rw
def test_writing(self, path):
if sys.platform == "win32":
- raise SkipTest("FIXME: Currently fail on windows")
+ pytest.skip("FIXME: Currently fail on windows")
pdb = PackedDB(path)
diff --git a/gitdb/test/lib.py b/gitdb/test/lib.py
index a04084f..abd4ad5 100644
--- a/gitdb/test/lib.py
+++ b/gitdb/test/lib.py
@@ -65,8 +65,8 @@ def skip_on_travis_ci(func):
@wraps(func)
def wrapper(self, *args, **kwargs):
if 'TRAVIS' in os.environ:
- import nose
- raise nose.SkipTest("Cannot run on travis-ci")
+ import pytest
+ pytest.skip("Cannot run on travis-ci")
# end check for travis ci
return func(self, *args, **kwargs)
# end wrapper
diff --git a/gitdb/test/test_pack.py b/gitdb/test/test_pack.py
index 48a1852..81a6bfc 100644
--- a/gitdb/test/test_pack.py
+++ b/gitdb/test/test_pack.py
@@ -26,7 +26,7 @@ from gitdb.fun import delta_types
from gitdb.exc import UnsupportedOperation
from gitdb.util import to_bin_sha
-from nose import SkipTest
+import pytest
import os
import tempfile
@@ -246,4 +246,4 @@ class TestPack(TestBase):
def test_pack_64(self):
# TODO: hex-edit a pack helping us to verify that we can handle 64 byte offsets
# of course without really needing such a huge pack
- raise SkipTest()
+ pytest.skip('not implemented')
--
2.34.1