Skip to content

Switch from nose to pytest #79

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ jobs:
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with nose
- name: Test with pytest
run: |
pip install nose
pip install pytest
ulimit -n 48
ulimit -n
nosetests -v
pytest -v
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
PYTHON = python
SETUP = $(PYTHON) setup.py
TESTRUNNER = $(shell which nosetests)
TESTFLAGS =

all::
Expand Down Expand Up @@ -37,5 +36,5 @@ clean::
rm -f *.so

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

4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ If you want to go up to 20% faster, you can install gitdb-speedups with:
REQUIREMENTS
============

* Python Nose - for running the tests
* pytest - for running the tests

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

Run the tests with

nosetests
pytest

DEVELOPMENT
===========
Expand Down
3 changes: 1 addition & 2 deletions gitdb.pro.user
Original file line number Diff line number Diff line change
Expand Up @@ -233,8 +233,7 @@
</valuemap>
<valuemap key="ProjectExplorer.Target.RunConfiguration.1" type="QVariantMap">
<valuelist key="ProjectExplorer.CustomExecutableRunConfiguration.Arguments" type="QVariantList">
<value type="QString">/usr/bin/nosetests</value>
<value type="QString">-s</value>
<value type="QString">/usr/bin/pytest</value>
<value type="QString">gitdb/test/test_pack.py</value>
</valuelist>
<value key="ProjectExplorer.CustomExecutableRunConfiguration.BaseEnvironmentBase" type="int">2</value>
Expand Down
4 changes: 2 additions & 2 deletions gitdb/test/db/test_pack.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,15 @@
import random
import sys

from nose.plugins.skip import SkipTest
import pytest

class TestPackDB(TestDBBase):

@with_rw_directory
@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)

Expand Down
4 changes: 2 additions & 2 deletions gitdb/test/lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions gitdb/test/test_pack.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
from gitdb.exc import UnsupportedOperation
from gitdb.util import to_bin_sha

from nose import SkipTest
import pytest

import os
import tempfile
Expand Down Expand Up @@ -246,4 +246,4 @@ def rewind_streams():
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')