Skip to content
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

move test and avoid packaging them #1028

Merged
merged 4 commits into from
Jul 12, 2020
Merged
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
2 changes: 1 addition & 1 deletion .deepsource.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version = 1

test_patterns = [
'git/test/**/test_*.py'
'test/**/test_*.py'
]

exclude_patterns = [
2 changes: 1 addition & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
git/test/fixtures/* eol=lf
test/fixtures/* eol=lf
init-tests-after-clone.sh
2 changes: 1 addition & 1 deletion .github/workflows/pythonpackage.yml
Original file line number Diff line number Diff line change
@@ -40,7 +40,7 @@ jobs:
git config --global user.name "Travis Runner"
# If we rewrite the user's config by accident, we will mess it up
# and cause subsequent tests to fail
cat git/test/fixtures/.gitconfig >> ~/.gitconfig
cat test/fixtures/.gitconfig >> ~/.gitconfig
- name: Lint with flake8
run: |
set -x
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -36,7 +36,7 @@ script:
# Make sure we limit open handles to see if we are leaking them
- ulimit -n 128
- ulimit -n
- coverage run --omit="git/test/*" -m unittest --buffer
- coverage run --omit="test/*" -m unittest --buffer
- coverage report
- if [ "$TRAVIS_PYTHON_VERSION" == '3.5' ]; then cd doc && make html; fi
- if [ "$TRAVIS_PYTHON_VERSION" == '3.6' ]; then flake8 --ignore=W293,E265,E266,W503,W504,E731; fi
5 changes: 1 addition & 4 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -5,11 +5,8 @@ include AUTHORS
include CONTRIBUTING.md
include README.md
include requirements.txt
include test-requirements.txt

recursive-include doc *

graft git/test/fixtures
graft git/test/performance
recursive-exclude test *

global-exclude __pycache__ *.pyc
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -74,9 +74,9 @@ def _stamp_version(filename):
author="Sebastian Thiel, Michael Trier",
author_email="byronimo@gmail.com, mtrier@gmail.com",
url="https://github.com/gitpython-developers/GitPython",
packages=find_packages('.'),
packages=find_packages(exclude=("test.*")),
include_package_data=True,
py_modules=['git.' + f[:-3] for f in os.listdir('./git') if f.endswith('.py')],
package_data={'git.test': ['fixtures/*']},
package_dir={'git': 'git'},
python_requires='>=3.4',
install_requires=requirements,
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -56,26 +56,26 @@ index f2233fbf40f3f69309ce5cc714e99fcbdcd33ec3..a88a777df3909a61be97f1a7b1194dad
@@ -1 +1 @@
-Subproject commit f2233fbf40f3f69309ce5cc714e99fcbdcd33ec3
+Subproject commit a88a777df3909a61be97f1a7b1194dad6de25702-dirty
diff --git a/git/test/fixtures/diff_patch_binary b/git/test/fixtures/diff_patch_binary
diff --git a/test/fixtures/diff_patch_binary b/test/fixtures/diff_patch_binary
new file mode 100644
index 0000000000000000000000000000000000000000..c92ccd6ebc92a871d38ad7cb8a48bcdb1a5dbc33
--- /dev/null
+++ b/git/test/fixtures/diff_patch_binary
+++ b/test/fixtures/diff_patch_binary
@@ -0,0 +1,3 @@
+diff --git a/rps b/rps
+index f4567df37451b230b1381b1bc9c2bcad76e08a3c..736bd596a36924d30b480942e9475ce0d734fa0d 100755
+Binary files a/rps and b/rps differ
diff --git a/git/test/fixtures/diff_raw_binary b/git/test/fixtures/diff_raw_binary
diff --git a/test/fixtures/diff_raw_binary b/test/fixtures/diff_raw_binary
new file mode 100644
index 0000000000000000000000000000000000000000..d4673fa41ee8413384167fc7b9f25e4daf18a53a
--- /dev/null
+++ b/git/test/fixtures/diff_raw_binary
+++ b/test/fixtures/diff_raw_binary
@@ -0,0 +1 @@
+:100755 100755 f4567df37451b230b1381b1bc9c2bcad76e08a3c 736bd596a36924d30b480942e9475ce0d734fa0d M rps
diff --git a/git/test/test_diff.py b/git/test/test_diff.py
diff --git a/test/test_diff.py b/test/test_diff.py
index ce0f64f2261bd8de063233108caac1f26742c1fd..4de26f8884fd048ac7f10007f2bf7c7fa3fa60f4 100644
--- a/git/test/test_diff.py
+++ b/git/test/test_diff.py
--- a/test/test_diff.py
+++ b/test/test_diff.py
@@ -65,6 +65,21 @@ class TestDiff(TestBase):
assert diff.rename_to == 'that'
assert len(list(diffs.iter_change_type('R'))) == 1
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion git/test/lib/helper.py → test/lib/helper.py
Original file line number Diff line number Diff line change
@@ -29,7 +29,7 @@

ospd = osp.dirname

GIT_REPO = os.environ.get("GIT_PYTHON_TEST_GIT_REPO_BASE", ospd(ospd(ospd(ospd(__file__)))))
GIT_REPO = os.environ.get("GIT_PYTHON_TEST_GIT_REPO_BASE", ospd(ospd(ospd(__file__))))
GIT_DAEMON_PORT = os.environ.get("GIT_PYTHON_TEST_GIT_DAEMON_PORT", "19418")

__all__ = (
File renamed without changes.
2 changes: 1 addition & 1 deletion git/test/performance/lib.py → test/performance/lib.py
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@
GitCmdObjectDB,
GitDB
)
from git.test.lib import (
from test.lib import (
TestBase
)
from git.util import rmtree
Original file line number Diff line number Diff line change
@@ -11,7 +11,7 @@
from .lib import TestBigRepoRW
from git import Commit
from gitdb import IStream
from git.test.test_commit import TestCommitSerialization
from test.test_commit import TestCommitSerialization


class TestPerformance(TestBigRepoRW, TestCommitSerialization):
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@
import sys
from time import time

from git.test.lib import (
from test.lib import (
with_rw_repo
)
from git.util import bin_to_hex
2 changes: 1 addition & 1 deletion git/test/test_actor.py → test/test_actor.py
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@
# This module is part of GitPython and is released under
# the BSD License: http://www.opensource.org/licenses/bsd-license.php

from git.test.lib import TestBase
from test.lib import TestBase
from git import Actor


2 changes: 1 addition & 1 deletion git/test/test_base.py → test/test_base.py
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@
)
from git.compat import is_win
from git.objects.util import get_object_type_by_name
from git.test.lib import (
from test.lib import (
TestBase,
with_rw_repo,
with_rw_and_rw_remote_repo
2 changes: 1 addition & 1 deletion git/test/test_blob.py → test/test_blob.py
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@
# This module is part of GitPython and is released under
# the BSD License: http://www.opensource.org/licenses/bsd-license.php

from git.test.lib import TestBase
from test.lib import TestBase
from git import Blob


4 changes: 2 additions & 2 deletions git/test/test_commit.py → test/test_commit.py
Original file line number Diff line number Diff line change
@@ -20,13 +20,13 @@
from git import Repo
from git.objects.util import tzoffset, utc
from git.repo.fun import touch
from git.test.lib import (
from test.lib import (
TestBase,
with_rw_repo,
fixture_path,
StringProcessAdapter
)
from git.test.lib import with_rw_directory
from test.lib import with_rw_directory
from gitdb import IStream

import os.path as osp
4 changes: 2 additions & 2 deletions git/test/test_config.py → test/test_config.py
Original file line number Diff line number Diff line change
@@ -11,12 +11,12 @@
GitConfigParser
)
from git.config import _OMD, cp
from git.test.lib import (
from test.lib import (
TestCase,
fixture_path,
SkipTest,
)
from git.test.lib import with_rw_directory
from test.lib import with_rw_directory

import os.path as osp
from git.util import rmfile
2 changes: 1 addition & 1 deletion git/test/test_db.py → test/test_db.py
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
from git.db import GitCmdObjectDB
from git.exc import BadObject
from git.test.lib import TestBase
from test.lib import TestBase
from git.util import bin_to_hex

import os.path as osp
4 changes: 2 additions & 2 deletions git/test/test_diff.py → test/test_diff.py
Original file line number Diff line number Diff line change
@@ -16,12 +16,12 @@
Submodule,
)
from git.cmd import Git
from git.test.lib import (
from test.lib import (
TestBase,
StringProcessAdapter,
fixture,
)
from git.test.lib import with_rw_directory
from test.lib import with_rw_directory

import os.path as osp

4 changes: 2 additions & 2 deletions git/test/test_docs.py → test/test_docs.py
Original file line number Diff line number Diff line change
@@ -6,8 +6,8 @@
# the BSD License: http://www.opensource.org/licenses/bsd-license.php
import os

from git.test.lib import TestBase
from git.test.lib.helper import with_rw_directory
from test.lib import TestBase
from test.lib.helper import with_rw_directory

import os.path

2 changes: 1 addition & 1 deletion git/test/test_exc.py → test/test_exc.py
Original file line number Diff line number Diff line change
@@ -22,7 +22,7 @@
HookExecutionError,
RepositoryDirtyError,
)
from git.test.lib import TestBase
from test.lib import TestBase

import itertools as itt

2 changes: 1 addition & 1 deletion git/test/test_fun.py → test/test_fun.py
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@
from git.repo.fun import (
find_worktree_git_dir
)
from git.test.lib import (
from test.lib import (
TestBase,
with_rw_repo,
with_rw_directory
4 changes: 2 additions & 2 deletions git/test/test_git.py → test/test_git.py
Original file line number Diff line number Diff line change
@@ -19,11 +19,11 @@
cmd
)
from git.compat import is_darwin
from git.test.lib import (
from test.lib import (
TestBase,
fixture_path
)
from git.test.lib import with_rw_directory
from test.lib import with_rw_directory
from git.util import finalize_process

import os.path as osp
4 changes: 2 additions & 2 deletions git/test/test_index.py → test/test_index.py
Original file line number Diff line number Diff line change
@@ -36,13 +36,13 @@
IndexEntry
)
from git.objects import Blob
from git.test.lib import (
from test.lib import (
TestBase,
fixture_path,
fixture,
with_rw_repo
)
from git.test.lib import with_rw_directory
from test.lib import with_rw_directory
from git.util import Actor, rmtree
from git.util import HIDE_WINDOWS_KNOWN_ERRORS, hex_to_bin
from gitdb.base import IStream
2 changes: 1 addition & 1 deletion git/test/test_reflog.py → test/test_reflog.py
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@
RefLogEntry,
RefLog
)
from git.test.lib import (
from test.lib import (
TestBase,
fixture_path
)
2 changes: 1 addition & 1 deletion git/test/test_refs.py → test/test_refs.py
Original file line number Diff line number Diff line change
@@ -17,7 +17,7 @@
RefLog
)
from git.objects.tag import TagObject
from git.test.lib import (
from test.lib import (
TestBase,
with_rw_repo
)
2 changes: 1 addition & 1 deletion git/test/test_remote.py → test/test_remote.py
Original file line number Diff line number Diff line change
@@ -22,7 +22,7 @@
GitCommandError
)
from git.cmd import Git
from git.test.lib import (
from test.lib import (
TestBase,
with_rw_repo,
with_rw_and_rw_remote_repo,
6 changes: 3 additions & 3 deletions git/test/test_repo.py → test/test_repo.py
Original file line number Diff line number Diff line change
@@ -36,13 +36,13 @@
BadObject,
)
from git.repo.fun import touch
from git.test.lib import (
from test.lib import (
TestBase,
with_rw_repo,
fixture
)
from git.util import HIDE_WINDOWS_KNOWN_ERRORS, cygpath
from git.test.lib import with_rw_directory
from test.lib import with_rw_directory
from git.util import join_path_native, rmtree, rmfile, bin_to_hex

import os.path as osp
@@ -865,7 +865,7 @@ def last_commit(repo, rev, path):
for _ in range(64):
for repo_type in (GitCmdObjectDB, GitDB):
repo = Repo(self.rorepo.working_tree_dir, odbt=repo_type)
last_commit(repo, 'master', 'git/test/test_base.py')
last_commit(repo, 'master', 'test/test_base.py')
# end for each repository type
# end for each iteration

2 changes: 1 addition & 1 deletion git/test/test_stats.py → test/test_stats.py
Original file line number Diff line number Diff line change
@@ -4,7 +4,7 @@
# This module is part of GitPython and is released under
# the BSD License: http://www.opensource.org/licenses/bsd-license.php

from git.test.lib import (
from test.lib import (
TestBase,
fixture
)
4 changes: 2 additions & 2 deletions git/test/test_submodule.py → test/test_submodule.py
Original file line number Diff line number Diff line change
@@ -19,11 +19,11 @@
find_submodule_git_dir,
touch
)
from git.test.lib import (
from test.lib import (
TestBase,
with_rw_repo
)
from git.test.lib import with_rw_directory
from test.lib import with_rw_directory
from git.util import HIDE_WINDOWS_KNOWN_ERRORS
from git.util import to_native_path_linux, join_path_native
import os.path as osp
2 changes: 1 addition & 1 deletion git/test/test_tree.py → test/test_tree.py
Original file line number Diff line number Diff line change
@@ -12,7 +12,7 @@
Tree,
Blob
)
from git.test.lib import TestBase
from test.lib import TestBase
from git.util import HIDE_WINDOWS_KNOWN_ERRORS

import os.path as osp
2 changes: 1 addition & 1 deletion git/test/test_util.py → test/test_util.py
Original file line number Diff line number Diff line change
@@ -21,7 +21,7 @@
parse_date,
tzoffset,
from_timestamp)
from git.test.lib import TestBase
from test.lib import TestBase
from git.util import (
LockFile,
BlockingLockFile,