Skip to content

Commit e3a4cfe

Browse files
carlwgeorgeByron
authored andcommitted
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. Resolves #72
1 parent 2913a64 commit e3a4cfe

File tree

7 files changed

+13
-15
lines changed

7 files changed

+13
-15
lines changed

.github/workflows/pythonpackage.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,9 @@ jobs:
3636
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
3737
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
3838
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
39-
- name: Test with nose
39+
- name: Test with pytest
4040
run: |
41-
pip install nose
41+
pip install pytest
4242
ulimit -n 48
4343
ulimit -n
44-
nosetests -v
44+
pytest -v

Makefile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
PYTHON = python
22
SETUP = $(PYTHON) setup.py
3-
TESTRUNNER = $(shell which nosetests)
43
TESTFLAGS =
54

65
all::
@@ -37,5 +36,5 @@ clean::
3736
rm -f *.so
3837

3938
coverage:: build
40-
PYTHONPATH=. $(PYTHON) $(TESTRUNNER) --cover-package=gitdb --with-coverage --cover-erase --cover-inclusive gitdb
39+
PYTHONPATH=. $(PYTHON) -m pytest --cov=gitdb gitdb
4140

README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ If you want to go up to 20% faster, you can install gitdb-speedups with:
3030
REQUIREMENTS
3131
============
3232

33-
* Python Nose - for running the tests
33+
* pytest - for running the tests
3434

3535
SOURCE
3636
======
@@ -45,7 +45,7 @@ Once the clone is complete, please be sure to initialize the submodules using
4545

4646
Run the tests with
4747

48-
nosetests
48+
pytest
4949

5050
DEVELOPMENT
5151
===========

gitdb.pro.user

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -233,8 +233,7 @@
233233
</valuemap>
234234
<valuemap key="ProjectExplorer.Target.RunConfiguration.1" type="QVariantMap">
235235
<valuelist key="ProjectExplorer.CustomExecutableRunConfiguration.Arguments" type="QVariantList">
236-
<value type="QString">/usr/bin/nosetests</value>
237-
<value type="QString">-s</value>
236+
<value type="QString">/usr/bin/pytest</value>
238237
<value type="QString">gitdb/test/test_pack.py</value>
239238
</valuelist>
240239
<value key="ProjectExplorer.CustomExecutableRunConfiguration.BaseEnvironmentBase" type="int">2</value>

gitdb/test/db/test_pack.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@
1616
import random
1717
import sys
1818

19-
from nose.plugins.skip import SkipTest
19+
import pytest
2020

2121
class TestPackDB(TestDBBase):
2222

2323
@with_rw_directory
2424
@with_packs_rw
2525
def test_writing(self, path):
2626
if sys.platform == "win32":
27-
raise SkipTest("FIXME: Currently fail on windows")
27+
pytest.skip("FIXME: Currently fail on windows")
2828

2929
pdb = PackedDB(path)
3030

gitdb/test/lib.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,8 @@ def skip_on_travis_ci(func):
6565
@wraps(func)
6666
def wrapper(self, *args, **kwargs):
6767
if 'TRAVIS' in os.environ:
68-
import nose
69-
raise nose.SkipTest("Cannot run on travis-ci")
68+
import pytest
69+
pytest.skip("Cannot run on travis-ci")
7070
# end check for travis ci
7171
return func(self, *args, **kwargs)
7272
# end wrapper

gitdb/test/test_pack.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
from gitdb.exc import UnsupportedOperation
2727
from gitdb.util import to_bin_sha
2828

29-
from nose import SkipTest
29+
import pytest
3030

3131
import os
3232
import tempfile
@@ -246,4 +246,4 @@ def rewind_streams():
246246
def test_pack_64(self):
247247
# TODO: hex-edit a pack helping us to verify that we can handle 64 byte offsets
248248
# of course without really needing such a huge pack
249-
raise SkipTest()
249+
pytest.skip('not implemented')

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy