From 0374d7cf84ecd8182b74a639fcfdb9eafddcfd15 Mon Sep 17 00:00:00 2001 From: Konrad Weihmann Date: Fri, 10 Jul 2020 18:41:02 +0200 Subject: [PATCH 1/5] tests: move to root dir This should ensure that tests are NOT packaged into release package by setuptools, as tests are development only + fixtures after moving Signed-off-by: Konrad Weihmann --- {git/test => test}/__init__.py | 0 {git/test => test}/fixtures/.gitconfig | 0 {git/test => test}/fixtures/blame | 0 {git/test => test}/fixtures/blame_binary | Bin .../test => test}/fixtures/blame_complex_revision | 0 {git/test => test}/fixtures/blame_incremental | 0 .../fixtures/blame_incremental_2.11.1_plus | 0 {git/test => test}/fixtures/cat_file.py | 0 {git/test => test}/fixtures/cat_file_blob | 0 {git/test => test}/fixtures/cat_file_blob_nl | 0 {git/test => test}/fixtures/cat_file_blob_size | 0 {git/test => test}/fixtures/commit_invalid_data | 0 {git/test => test}/fixtures/commit_with_gpgsig | 0 {git/test => test}/fixtures/diff_2 | 0 {git/test => test}/fixtures/diff_2f | 0 .../diff_abbrev-40_full-index_M_raw_no-color | 0 {git/test => test}/fixtures/diff_change_in_type | 0 .../fixtures/diff_change_in_type_raw | 0 {git/test => test}/fixtures/diff_copied_mode | 0 {git/test => test}/fixtures/diff_copied_mode_raw | 0 {git/test => test}/fixtures/diff_f | 0 {git/test => test}/fixtures/diff_file_with_spaces | 0 {git/test => test}/fixtures/diff_i | 0 {git/test => test}/fixtures/diff_index_patch | 14 +++++++------- {git/test => test}/fixtures/diff_index_raw | 0 {git/test => test}/fixtures/diff_initial | 0 {git/test => test}/fixtures/diff_mode_only | 0 {git/test => test}/fixtures/diff_new_mode | 0 {git/test => test}/fixtures/diff_numstat | 0 {git/test => test}/fixtures/diff_p | 0 {git/test => test}/fixtures/diff_patch_binary | 0 .../fixtures/diff_patch_unsafe_paths | 0 {git/test => test}/fixtures/diff_raw_binary | 0 {git/test => test}/fixtures/diff_rename | 0 {git/test => test}/fixtures/diff_rename_raw | 0 .../test => test}/fixtures/diff_tree_numstat_root | 0 .../fixtures/for_each_ref_with_path_component | Bin {git/test => test}/fixtures/git_config | 0 {git/test => test}/fixtures/git_config-inc.cfg | 0 {git/test => test}/fixtures/git_config_global | 0 {git/test => test}/fixtures/git_config_multiple | 0 .../fixtures/git_config_with_comments | 0 .../fixtures/git_config_with_empty_value | 0 {git/test => test}/fixtures/git_file | 0 {git/test => test}/fixtures/index | Bin {git/test => test}/fixtures/index_merge | Bin {git/test => test}/fixtures/issue-301_stderr | 0 {git/test => test}/fixtures/ls_tree_a | 0 {git/test => test}/fixtures/ls_tree_b | 0 {git/test => test}/fixtures/ls_tree_commit | 0 {git/test => test}/fixtures/ls_tree_empty | 0 {git/test => test}/fixtures/reflog_HEAD | 0 {git/test => test}/fixtures/reflog_invalid_date | 0 {git/test => test}/fixtures/reflog_invalid_email | 0 {git/test => test}/fixtures/reflog_invalid_newsha | 0 {git/test => test}/fixtures/reflog_invalid_oldsha | 0 {git/test => test}/fixtures/reflog_invalid_sep | 0 {git/test => test}/fixtures/reflog_master | 0 {git/test => test}/fixtures/rev_list | 0 {git/test => test}/fixtures/rev_list_bisect_all | 0 {git/test => test}/fixtures/rev_list_commit_diffs | 0 .../fixtures/rev_list_commit_idabbrev | 0 {git/test => test}/fixtures/rev_list_commit_stats | 0 {git/test => test}/fixtures/rev_list_count | 0 {git/test => test}/fixtures/rev_list_delta_a | 0 {git/test => test}/fixtures/rev_list_delta_b | 0 {git/test => test}/fixtures/rev_list_single | 0 {git/test => test}/fixtures/rev_parse | 0 {git/test => test}/fixtures/show_empty_commit | 0 .../fixtures/uncommon_branch_prefix_FETCH_HEAD | 0 .../fixtures/uncommon_branch_prefix_stderr | 0 {git/test => test}/lib/__init__.py | 0 {git/test => test}/lib/helper.py | 2 +- {git/test => test}/performance/__init__.py | 0 {git/test => test}/performance/lib.py | 2 +- {git/test => test}/performance/test_commit.py | 2 +- {git/test => test}/performance/test_odb.py | 0 {git/test => test}/performance/test_streams.py | 2 +- {git/test => test}/test_actor.py | 2 +- {git/test => test}/test_base.py | 2 +- {git/test => test}/test_blob.py | 2 +- {git/test => test}/test_commit.py | 4 ++-- {git/test => test}/test_config.py | 4 ++-- {git/test => test}/test_db.py | 2 +- {git/test => test}/test_diff.py | 4 ++-- {git/test => test}/test_docs.py | 4 ++-- {git/test => test}/test_exc.py | 2 +- {git/test => test}/test_fun.py | 2 +- {git/test => test}/test_git.py | 4 ++-- {git/test => test}/test_index.py | 4 ++-- {git/test => test}/test_reflog.py | 2 +- {git/test => test}/test_refs.py | 2 +- {git/test => test}/test_remote.py | 2 +- {git/test => test}/test_repo.py | 6 +++--- {git/test => test}/test_stats.py | 2 +- {git/test => test}/test_submodule.py | 4 ++-- {git/test => test}/test_tree.py | 2 +- {git/test => test}/test_util.py | 2 +- 98 files changed, 40 insertions(+), 40 deletions(-) rename {git/test => test}/__init__.py (100%) rename {git/test => test}/fixtures/.gitconfig (100%) rename {git/test => test}/fixtures/blame (100%) rename {git/test => test}/fixtures/blame_binary (100%) rename {git/test => test}/fixtures/blame_complex_revision (100%) rename {git/test => test}/fixtures/blame_incremental (100%) rename {git/test => test}/fixtures/blame_incremental_2.11.1_plus (100%) rename {git/test => test}/fixtures/cat_file.py (100%) rename {git/test => test}/fixtures/cat_file_blob (100%) rename {git/test => test}/fixtures/cat_file_blob_nl (100%) rename {git/test => test}/fixtures/cat_file_blob_size (100%) rename {git/test => test}/fixtures/commit_invalid_data (100%) rename {git/test => test}/fixtures/commit_with_gpgsig (100%) rename {git/test => test}/fixtures/diff_2 (100%) rename {git/test => test}/fixtures/diff_2f (100%) rename {git/test => test}/fixtures/diff_abbrev-40_full-index_M_raw_no-color (100%) rename {git/test => test}/fixtures/diff_change_in_type (100%) rename {git/test => test}/fixtures/diff_change_in_type_raw (100%) rename {git/test => test}/fixtures/diff_copied_mode (100%) rename {git/test => test}/fixtures/diff_copied_mode_raw (100%) rename {git/test => test}/fixtures/diff_f (100%) rename {git/test => test}/fixtures/diff_file_with_spaces (100%) rename {git/test => test}/fixtures/diff_i (100%) rename {git/test => test}/fixtures/diff_index_patch (92%) rename {git/test => test}/fixtures/diff_index_raw (100%) rename {git/test => test}/fixtures/diff_initial (100%) rename {git/test => test}/fixtures/diff_mode_only (100%) rename {git/test => test}/fixtures/diff_new_mode (100%) rename {git/test => test}/fixtures/diff_numstat (100%) rename {git/test => test}/fixtures/diff_p (100%) rename {git/test => test}/fixtures/diff_patch_binary (100%) rename {git/test => test}/fixtures/diff_patch_unsafe_paths (100%) rename {git/test => test}/fixtures/diff_raw_binary (100%) rename {git/test => test}/fixtures/diff_rename (100%) rename {git/test => test}/fixtures/diff_rename_raw (100%) rename {git/test => test}/fixtures/diff_tree_numstat_root (100%) rename {git/test => test}/fixtures/for_each_ref_with_path_component (100%) rename {git/test => test}/fixtures/git_config (100%) rename {git/test => test}/fixtures/git_config-inc.cfg (100%) rename {git/test => test}/fixtures/git_config_global (100%) rename {git/test => test}/fixtures/git_config_multiple (100%) rename {git/test => test}/fixtures/git_config_with_comments (100%) rename {git/test => test}/fixtures/git_config_with_empty_value (100%) rename {git/test => test}/fixtures/git_file (100%) rename {git/test => test}/fixtures/index (100%) rename {git/test => test}/fixtures/index_merge (100%) rename {git/test => test}/fixtures/issue-301_stderr (100%) rename {git/test => test}/fixtures/ls_tree_a (100%) rename {git/test => test}/fixtures/ls_tree_b (100%) rename {git/test => test}/fixtures/ls_tree_commit (100%) rename {git/test => test}/fixtures/ls_tree_empty (100%) rename {git/test => test}/fixtures/reflog_HEAD (100%) rename {git/test => test}/fixtures/reflog_invalid_date (100%) rename {git/test => test}/fixtures/reflog_invalid_email (100%) rename {git/test => test}/fixtures/reflog_invalid_newsha (100%) rename {git/test => test}/fixtures/reflog_invalid_oldsha (100%) rename {git/test => test}/fixtures/reflog_invalid_sep (100%) rename {git/test => test}/fixtures/reflog_master (100%) rename {git/test => test}/fixtures/rev_list (100%) rename {git/test => test}/fixtures/rev_list_bisect_all (100%) rename {git/test => test}/fixtures/rev_list_commit_diffs (100%) rename {git/test => test}/fixtures/rev_list_commit_idabbrev (100%) rename {git/test => test}/fixtures/rev_list_commit_stats (100%) rename {git/test => test}/fixtures/rev_list_count (100%) rename {git/test => test}/fixtures/rev_list_delta_a (100%) rename {git/test => test}/fixtures/rev_list_delta_b (100%) rename {git/test => test}/fixtures/rev_list_single (100%) rename {git/test => test}/fixtures/rev_parse (100%) rename {git/test => test}/fixtures/show_empty_commit (100%) rename {git/test => test}/fixtures/uncommon_branch_prefix_FETCH_HEAD (100%) rename {git/test => test}/fixtures/uncommon_branch_prefix_stderr (100%) rename {git/test => test}/lib/__init__.py (100%) rename {git/test => test}/lib/helper.py (99%) rename {git/test => test}/performance/__init__.py (100%) rename {git/test => test}/performance/lib.py (98%) rename {git/test => test}/performance/test_commit.py (98%) rename {git/test => test}/performance/test_odb.py (100%) rename {git/test => test}/performance/test_streams.py (99%) rename {git/test => test}/test_actor.py (97%) rename {git/test => test}/test_base.py (99%) rename {git/test => test}/test_blob.py (96%) rename {git/test => test}/test_commit.py (99%) rename {git/test => test}/test_config.py (99%) rename {git/test => test}/test_db.py (96%) rename {git/test => test}/test_diff.py (99%) rename {git/test => test}/test_docs.py (99%) rename {git/test => test}/test_exc.py (99%) rename {git/test => test}/test_fun.py (99%) rename {git/test => test}/test_git.py (99%) rename {git/test => test}/test_index.py (99%) rename {git/test => test}/test_reflog.py (99%) rename {git/test => test}/test_refs.py (99%) rename {git/test => test}/test_remote.py (99%) rename {git/test => test}/test_repo.py (99%) rename {git/test => test}/test_stats.py (97%) rename {git/test => test}/test_submodule.py (99%) rename {git/test => test}/test_tree.py (99%) rename {git/test => test}/test_util.py (99%) diff --git a/git/test/__init__.py b/test/__init__.py similarity index 100% rename from git/test/__init__.py rename to test/__init__.py diff --git a/git/test/fixtures/.gitconfig b/test/fixtures/.gitconfig similarity index 100% rename from git/test/fixtures/.gitconfig rename to test/fixtures/.gitconfig diff --git a/git/test/fixtures/blame b/test/fixtures/blame similarity index 100% rename from git/test/fixtures/blame rename to test/fixtures/blame diff --git a/git/test/fixtures/blame_binary b/test/fixtures/blame_binary similarity index 100% rename from git/test/fixtures/blame_binary rename to test/fixtures/blame_binary diff --git a/git/test/fixtures/blame_complex_revision b/test/fixtures/blame_complex_revision similarity index 100% rename from git/test/fixtures/blame_complex_revision rename to test/fixtures/blame_complex_revision diff --git a/git/test/fixtures/blame_incremental b/test/fixtures/blame_incremental similarity index 100% rename from git/test/fixtures/blame_incremental rename to test/fixtures/blame_incremental diff --git a/git/test/fixtures/blame_incremental_2.11.1_plus b/test/fixtures/blame_incremental_2.11.1_plus similarity index 100% rename from git/test/fixtures/blame_incremental_2.11.1_plus rename to test/fixtures/blame_incremental_2.11.1_plus diff --git a/git/test/fixtures/cat_file.py b/test/fixtures/cat_file.py similarity index 100% rename from git/test/fixtures/cat_file.py rename to test/fixtures/cat_file.py diff --git a/git/test/fixtures/cat_file_blob b/test/fixtures/cat_file_blob similarity index 100% rename from git/test/fixtures/cat_file_blob rename to test/fixtures/cat_file_blob diff --git a/git/test/fixtures/cat_file_blob_nl b/test/fixtures/cat_file_blob_nl similarity index 100% rename from git/test/fixtures/cat_file_blob_nl rename to test/fixtures/cat_file_blob_nl diff --git a/git/test/fixtures/cat_file_blob_size b/test/fixtures/cat_file_blob_size similarity index 100% rename from git/test/fixtures/cat_file_blob_size rename to test/fixtures/cat_file_blob_size diff --git a/git/test/fixtures/commit_invalid_data b/test/fixtures/commit_invalid_data similarity index 100% rename from git/test/fixtures/commit_invalid_data rename to test/fixtures/commit_invalid_data diff --git a/git/test/fixtures/commit_with_gpgsig b/test/fixtures/commit_with_gpgsig similarity index 100% rename from git/test/fixtures/commit_with_gpgsig rename to test/fixtures/commit_with_gpgsig diff --git a/git/test/fixtures/diff_2 b/test/fixtures/diff_2 similarity index 100% rename from git/test/fixtures/diff_2 rename to test/fixtures/diff_2 diff --git a/git/test/fixtures/diff_2f b/test/fixtures/diff_2f similarity index 100% rename from git/test/fixtures/diff_2f rename to test/fixtures/diff_2f diff --git a/git/test/fixtures/diff_abbrev-40_full-index_M_raw_no-color b/test/fixtures/diff_abbrev-40_full-index_M_raw_no-color similarity index 100% rename from git/test/fixtures/diff_abbrev-40_full-index_M_raw_no-color rename to test/fixtures/diff_abbrev-40_full-index_M_raw_no-color diff --git a/git/test/fixtures/diff_change_in_type b/test/fixtures/diff_change_in_type similarity index 100% rename from git/test/fixtures/diff_change_in_type rename to test/fixtures/diff_change_in_type diff --git a/git/test/fixtures/diff_change_in_type_raw b/test/fixtures/diff_change_in_type_raw similarity index 100% rename from git/test/fixtures/diff_change_in_type_raw rename to test/fixtures/diff_change_in_type_raw diff --git a/git/test/fixtures/diff_copied_mode b/test/fixtures/diff_copied_mode similarity index 100% rename from git/test/fixtures/diff_copied_mode rename to test/fixtures/diff_copied_mode diff --git a/git/test/fixtures/diff_copied_mode_raw b/test/fixtures/diff_copied_mode_raw similarity index 100% rename from git/test/fixtures/diff_copied_mode_raw rename to test/fixtures/diff_copied_mode_raw diff --git a/git/test/fixtures/diff_f b/test/fixtures/diff_f similarity index 100% rename from git/test/fixtures/diff_f rename to test/fixtures/diff_f diff --git a/git/test/fixtures/diff_file_with_spaces b/test/fixtures/diff_file_with_spaces similarity index 100% rename from git/test/fixtures/diff_file_with_spaces rename to test/fixtures/diff_file_with_spaces diff --git a/git/test/fixtures/diff_i b/test/fixtures/diff_i similarity index 100% rename from git/test/fixtures/diff_i rename to test/fixtures/diff_i diff --git a/git/test/fixtures/diff_index_patch b/test/fixtures/diff_index_patch similarity index 92% rename from git/test/fixtures/diff_index_patch rename to test/fixtures/diff_index_patch index a5a8cff24..f617f8dee 100644 --- a/git/test/fixtures/diff_index_patch +++ b/test/fixtures/diff_index_patch @@ -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 diff --git a/git/test/fixtures/diff_index_raw b/test/fixtures/diff_index_raw similarity index 100% rename from git/test/fixtures/diff_index_raw rename to test/fixtures/diff_index_raw diff --git a/git/test/fixtures/diff_initial b/test/fixtures/diff_initial similarity index 100% rename from git/test/fixtures/diff_initial rename to test/fixtures/diff_initial diff --git a/git/test/fixtures/diff_mode_only b/test/fixtures/diff_mode_only similarity index 100% rename from git/test/fixtures/diff_mode_only rename to test/fixtures/diff_mode_only diff --git a/git/test/fixtures/diff_new_mode b/test/fixtures/diff_new_mode similarity index 100% rename from git/test/fixtures/diff_new_mode rename to test/fixtures/diff_new_mode diff --git a/git/test/fixtures/diff_numstat b/test/fixtures/diff_numstat similarity index 100% rename from git/test/fixtures/diff_numstat rename to test/fixtures/diff_numstat diff --git a/git/test/fixtures/diff_p b/test/fixtures/diff_p similarity index 100% rename from git/test/fixtures/diff_p rename to test/fixtures/diff_p diff --git a/git/test/fixtures/diff_patch_binary b/test/fixtures/diff_patch_binary similarity index 100% rename from git/test/fixtures/diff_patch_binary rename to test/fixtures/diff_patch_binary diff --git a/git/test/fixtures/diff_patch_unsafe_paths b/test/fixtures/diff_patch_unsafe_paths similarity index 100% rename from git/test/fixtures/diff_patch_unsafe_paths rename to test/fixtures/diff_patch_unsafe_paths diff --git a/git/test/fixtures/diff_raw_binary b/test/fixtures/diff_raw_binary similarity index 100% rename from git/test/fixtures/diff_raw_binary rename to test/fixtures/diff_raw_binary diff --git a/git/test/fixtures/diff_rename b/test/fixtures/diff_rename similarity index 100% rename from git/test/fixtures/diff_rename rename to test/fixtures/diff_rename diff --git a/git/test/fixtures/diff_rename_raw b/test/fixtures/diff_rename_raw similarity index 100% rename from git/test/fixtures/diff_rename_raw rename to test/fixtures/diff_rename_raw diff --git a/git/test/fixtures/diff_tree_numstat_root b/test/fixtures/diff_tree_numstat_root similarity index 100% rename from git/test/fixtures/diff_tree_numstat_root rename to test/fixtures/diff_tree_numstat_root diff --git a/git/test/fixtures/for_each_ref_with_path_component b/test/fixtures/for_each_ref_with_path_component similarity index 100% rename from git/test/fixtures/for_each_ref_with_path_component rename to test/fixtures/for_each_ref_with_path_component diff --git a/git/test/fixtures/git_config b/test/fixtures/git_config similarity index 100% rename from git/test/fixtures/git_config rename to test/fixtures/git_config diff --git a/git/test/fixtures/git_config-inc.cfg b/test/fixtures/git_config-inc.cfg similarity index 100% rename from git/test/fixtures/git_config-inc.cfg rename to test/fixtures/git_config-inc.cfg diff --git a/git/test/fixtures/git_config_global b/test/fixtures/git_config_global similarity index 100% rename from git/test/fixtures/git_config_global rename to test/fixtures/git_config_global diff --git a/git/test/fixtures/git_config_multiple b/test/fixtures/git_config_multiple similarity index 100% rename from git/test/fixtures/git_config_multiple rename to test/fixtures/git_config_multiple diff --git a/git/test/fixtures/git_config_with_comments b/test/fixtures/git_config_with_comments similarity index 100% rename from git/test/fixtures/git_config_with_comments rename to test/fixtures/git_config_with_comments diff --git a/git/test/fixtures/git_config_with_empty_value b/test/fixtures/git_config_with_empty_value similarity index 100% rename from git/test/fixtures/git_config_with_empty_value rename to test/fixtures/git_config_with_empty_value diff --git a/git/test/fixtures/git_file b/test/fixtures/git_file similarity index 100% rename from git/test/fixtures/git_file rename to test/fixtures/git_file diff --git a/git/test/fixtures/index b/test/fixtures/index similarity index 100% rename from git/test/fixtures/index rename to test/fixtures/index diff --git a/git/test/fixtures/index_merge b/test/fixtures/index_merge similarity index 100% rename from git/test/fixtures/index_merge rename to test/fixtures/index_merge diff --git a/git/test/fixtures/issue-301_stderr b/test/fixtures/issue-301_stderr similarity index 100% rename from git/test/fixtures/issue-301_stderr rename to test/fixtures/issue-301_stderr diff --git a/git/test/fixtures/ls_tree_a b/test/fixtures/ls_tree_a similarity index 100% rename from git/test/fixtures/ls_tree_a rename to test/fixtures/ls_tree_a diff --git a/git/test/fixtures/ls_tree_b b/test/fixtures/ls_tree_b similarity index 100% rename from git/test/fixtures/ls_tree_b rename to test/fixtures/ls_tree_b diff --git a/git/test/fixtures/ls_tree_commit b/test/fixtures/ls_tree_commit similarity index 100% rename from git/test/fixtures/ls_tree_commit rename to test/fixtures/ls_tree_commit diff --git a/git/test/fixtures/ls_tree_empty b/test/fixtures/ls_tree_empty similarity index 100% rename from git/test/fixtures/ls_tree_empty rename to test/fixtures/ls_tree_empty diff --git a/git/test/fixtures/reflog_HEAD b/test/fixtures/reflog_HEAD similarity index 100% rename from git/test/fixtures/reflog_HEAD rename to test/fixtures/reflog_HEAD diff --git a/git/test/fixtures/reflog_invalid_date b/test/fixtures/reflog_invalid_date similarity index 100% rename from git/test/fixtures/reflog_invalid_date rename to test/fixtures/reflog_invalid_date diff --git a/git/test/fixtures/reflog_invalid_email b/test/fixtures/reflog_invalid_email similarity index 100% rename from git/test/fixtures/reflog_invalid_email rename to test/fixtures/reflog_invalid_email diff --git a/git/test/fixtures/reflog_invalid_newsha b/test/fixtures/reflog_invalid_newsha similarity index 100% rename from git/test/fixtures/reflog_invalid_newsha rename to test/fixtures/reflog_invalid_newsha diff --git a/git/test/fixtures/reflog_invalid_oldsha b/test/fixtures/reflog_invalid_oldsha similarity index 100% rename from git/test/fixtures/reflog_invalid_oldsha rename to test/fixtures/reflog_invalid_oldsha diff --git a/git/test/fixtures/reflog_invalid_sep b/test/fixtures/reflog_invalid_sep similarity index 100% rename from git/test/fixtures/reflog_invalid_sep rename to test/fixtures/reflog_invalid_sep diff --git a/git/test/fixtures/reflog_master b/test/fixtures/reflog_master similarity index 100% rename from git/test/fixtures/reflog_master rename to test/fixtures/reflog_master diff --git a/git/test/fixtures/rev_list b/test/fixtures/rev_list similarity index 100% rename from git/test/fixtures/rev_list rename to test/fixtures/rev_list diff --git a/git/test/fixtures/rev_list_bisect_all b/test/fixtures/rev_list_bisect_all similarity index 100% rename from git/test/fixtures/rev_list_bisect_all rename to test/fixtures/rev_list_bisect_all diff --git a/git/test/fixtures/rev_list_commit_diffs b/test/fixtures/rev_list_commit_diffs similarity index 100% rename from git/test/fixtures/rev_list_commit_diffs rename to test/fixtures/rev_list_commit_diffs diff --git a/git/test/fixtures/rev_list_commit_idabbrev b/test/fixtures/rev_list_commit_idabbrev similarity index 100% rename from git/test/fixtures/rev_list_commit_idabbrev rename to test/fixtures/rev_list_commit_idabbrev diff --git a/git/test/fixtures/rev_list_commit_stats b/test/fixtures/rev_list_commit_stats similarity index 100% rename from git/test/fixtures/rev_list_commit_stats rename to test/fixtures/rev_list_commit_stats diff --git a/git/test/fixtures/rev_list_count b/test/fixtures/rev_list_count similarity index 100% rename from git/test/fixtures/rev_list_count rename to test/fixtures/rev_list_count diff --git a/git/test/fixtures/rev_list_delta_a b/test/fixtures/rev_list_delta_a similarity index 100% rename from git/test/fixtures/rev_list_delta_a rename to test/fixtures/rev_list_delta_a diff --git a/git/test/fixtures/rev_list_delta_b b/test/fixtures/rev_list_delta_b similarity index 100% rename from git/test/fixtures/rev_list_delta_b rename to test/fixtures/rev_list_delta_b diff --git a/git/test/fixtures/rev_list_single b/test/fixtures/rev_list_single similarity index 100% rename from git/test/fixtures/rev_list_single rename to test/fixtures/rev_list_single diff --git a/git/test/fixtures/rev_parse b/test/fixtures/rev_parse similarity index 100% rename from git/test/fixtures/rev_parse rename to test/fixtures/rev_parse diff --git a/git/test/fixtures/show_empty_commit b/test/fixtures/show_empty_commit similarity index 100% rename from git/test/fixtures/show_empty_commit rename to test/fixtures/show_empty_commit diff --git a/git/test/fixtures/uncommon_branch_prefix_FETCH_HEAD b/test/fixtures/uncommon_branch_prefix_FETCH_HEAD similarity index 100% rename from git/test/fixtures/uncommon_branch_prefix_FETCH_HEAD rename to test/fixtures/uncommon_branch_prefix_FETCH_HEAD diff --git a/git/test/fixtures/uncommon_branch_prefix_stderr b/test/fixtures/uncommon_branch_prefix_stderr similarity index 100% rename from git/test/fixtures/uncommon_branch_prefix_stderr rename to test/fixtures/uncommon_branch_prefix_stderr diff --git a/git/test/lib/__init__.py b/test/lib/__init__.py similarity index 100% rename from git/test/lib/__init__.py rename to test/lib/__init__.py diff --git a/git/test/lib/helper.py b/test/lib/helper.py similarity index 99% rename from git/test/lib/helper.py rename to test/lib/helper.py index 8de66e8a4..3412786d1 100644 --- a/git/test/lib/helper.py +++ b/test/lib/helper.py @@ -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__ = ( diff --git a/git/test/performance/__init__.py b/test/performance/__init__.py similarity index 100% rename from git/test/performance/__init__.py rename to test/performance/__init__.py diff --git a/git/test/performance/lib.py b/test/performance/lib.py similarity index 98% rename from git/test/performance/lib.py rename to test/performance/lib.py index 7edffa783..86f877579 100644 --- a/git/test/performance/lib.py +++ b/test/performance/lib.py @@ -10,7 +10,7 @@ GitCmdObjectDB, GitDB ) -from git.test.lib import ( +from test.lib import ( TestBase ) from git.util import rmtree diff --git a/git/test/performance/test_commit.py b/test/performance/test_commit.py similarity index 98% rename from git/test/performance/test_commit.py rename to test/performance/test_commit.py index 578194a2e..4617b052c 100644 --- a/git/test/performance/test_commit.py +++ b/test/performance/test_commit.py @@ -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): diff --git a/git/test/performance/test_odb.py b/test/performance/test_odb.py similarity index 100% rename from git/test/performance/test_odb.py rename to test/performance/test_odb.py diff --git a/git/test/performance/test_streams.py b/test/performance/test_streams.py similarity index 99% rename from git/test/performance/test_streams.py rename to test/performance/test_streams.py index cc6f0335c..edf32c915 100644 --- a/git/test/performance/test_streams.py +++ b/test/performance/test_streams.py @@ -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 diff --git a/git/test/test_actor.py b/test/test_actor.py similarity index 97% rename from git/test/test_actor.py rename to test/test_actor.py index 010b82f6e..32d16ea71 100644 --- a/git/test/test_actor.py +++ b/test/test_actor.py @@ -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 diff --git a/git/test/test_base.py b/test/test_base.py similarity index 99% rename from git/test/test_base.py rename to test/test_base.py index 9da7c4718..02963ce0a 100644 --- a/git/test/test_base.py +++ b/test/test_base.py @@ -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 diff --git a/git/test/test_blob.py b/test/test_blob.py similarity index 96% rename from git/test/test_blob.py rename to test/test_blob.py index 88c505012..c9c8c48ab 100644 --- a/git/test/test_blob.py +++ b/test/test_blob.py @@ -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 diff --git a/git/test/test_commit.py b/test/test_commit.py similarity index 99% rename from git/test/test_commit.py rename to test/test_commit.py index 2b901e8b8..0292545f0 100644 --- a/git/test/test_commit.py +++ b/test/test_commit.py @@ -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 diff --git a/git/test/test_config.py b/test/test_config.py similarity index 99% rename from git/test/test_config.py rename to test/test_config.py index 8418299f5..720d775ee 100644 --- a/git/test/test_config.py +++ b/test/test_config.py @@ -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 diff --git a/git/test/test_db.py b/test/test_db.py similarity index 96% rename from git/test/test_db.py rename to test/test_db.py index bd16452dc..f9090fdda 100644 --- a/git/test/test_db.py +++ b/test/test_db.py @@ -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 diff --git a/git/test/test_diff.py b/test/test_diff.py similarity index 99% rename from git/test/test_diff.py rename to test/test_diff.py index 0b4c1aa66..378a58de5 100644 --- a/git/test/test_diff.py +++ b/test/test_diff.py @@ -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 diff --git a/git/test/test_docs.py b/test/test_docs.py similarity index 99% rename from git/test/test_docs.py rename to test/test_docs.py index 2e4f1dbf9..15c8f8d79 100644 --- a/git/test/test_docs.py +++ b/test/test_docs.py @@ -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 diff --git a/git/test/test_exc.py b/test/test_exc.py similarity index 99% rename from git/test/test_exc.py rename to test/test_exc.py index 8024ec78e..f16498ab5 100644 --- a/git/test/test_exc.py +++ b/test/test_exc.py @@ -22,7 +22,7 @@ HookExecutionError, RepositoryDirtyError, ) -from git.test.lib import TestBase +from test.lib import TestBase import itertools as itt diff --git a/git/test/test_fun.py b/test/test_fun.py similarity index 99% rename from git/test/test_fun.py rename to test/test_fun.py index b0d1d8b6e..a7fb8f8bc 100644 --- a/git/test/test_fun.py +++ b/test/test_fun.py @@ -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 diff --git a/git/test/test_git.py b/test/test_git.py similarity index 99% rename from git/test/test_git.py rename to test/test_git.py index 1e3cac8fd..72c7ef62b 100644 --- a/git/test/test_git.py +++ b/test/test_git.py @@ -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 diff --git a/git/test/test_index.py b/test/test_index.py similarity index 99% rename from git/test/test_index.py rename to test/test_index.py index ce14537a3..1107f21d4 100644 --- a/git/test/test_index.py +++ b/test/test_index.py @@ -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 diff --git a/git/test/test_reflog.py b/test/test_reflog.py similarity index 99% rename from git/test/test_reflog.py rename to test/test_reflog.py index db5f2783a..a6c15950a 100644 --- a/git/test/test_reflog.py +++ b/test/test_reflog.py @@ -6,7 +6,7 @@ RefLogEntry, RefLog ) -from git.test.lib import ( +from test.lib import ( TestBase, fixture_path ) diff --git a/git/test/test_refs.py b/test/test_refs.py similarity index 99% rename from git/test/test_refs.py rename to test/test_refs.py index 4a0ebfded..8ab45d22c 100644 --- a/git/test/test_refs.py +++ b/test/test_refs.py @@ -17,7 +17,7 @@ RefLog ) from git.objects.tag import TagObject -from git.test.lib import ( +from test.lib import ( TestBase, with_rw_repo ) diff --git a/git/test/test_remote.py b/test/test_remote.py similarity index 99% rename from git/test/test_remote.py rename to test/test_remote.py index c659dd32c..fb7d23c6c 100644 --- a/git/test/test_remote.py +++ b/test/test_remote.py @@ -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, diff --git a/git/test/test_repo.py b/test/test_repo.py similarity index 99% rename from git/test/test_repo.py rename to test/test_repo.py index 590e303e6..0809175f4 100644 --- a/git/test/test_repo.py +++ b/test/test_repo.py @@ -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 diff --git a/git/test/test_stats.py b/test/test_stats.py similarity index 97% rename from git/test/test_stats.py rename to test/test_stats.py index 92f5c8aa8..2759698a9 100644 --- a/git/test/test_stats.py +++ b/test/test_stats.py @@ -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 ) diff --git a/git/test/test_submodule.py b/test/test_submodule.py similarity index 99% rename from git/test/test_submodule.py rename to test/test_submodule.py index dd036b7e8..eb821b54e 100644 --- a/git/test/test_submodule.py +++ b/test/test_submodule.py @@ -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 diff --git a/git/test/test_tree.py b/test/test_tree.py similarity index 99% rename from git/test/test_tree.py rename to test/test_tree.py index 213e7a95d..49b34c5e7 100644 --- a/git/test/test_tree.py +++ b/test/test_tree.py @@ -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 diff --git a/git/test/test_util.py b/test/test_util.py similarity index 99% rename from git/test/test_util.py rename to test/test_util.py index 77fbdeb96..26695df55 100644 --- a/git/test/test_util.py +++ b/test/test_util.py @@ -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, From c7e09792a392eeed4d712b40978b1b91b751a6d6 Mon Sep 17 00:00:00 2001 From: Konrad Weihmann Date: Fri, 10 Jul 2020 18:58:04 +0200 Subject: [PATCH 2/5] setup.py: exclude all test files by using exclude feature of find_packages. py_modules are determined by new function, which recursively scans the base dir but omits the external modules. Plus remove now obselete package_data setting Signed-off-by: Konrad Weihmann --- setup.py | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index 11a1d6b7c..306fd18d3 100755 --- a/setup.py +++ b/setup.py @@ -9,6 +9,7 @@ from distutils.command.build_py import build_py as _build_py from setuptools.command.sdist import sdist as _sdist +import fnmatch import os import sys from os import path @@ -66,6 +67,24 @@ def _stamp_version(filename): print("WARNING: Couldn't find version line in file %s" % filename, file=sys.stderr) +def build_py_modules(basedir, excludes=[]): + # create list of py_modules from tree + res = set() + _prefix = os.path.basename(basedir) + for root, _, files in os.walk(basedir): + for f in files: + _f, _ext = os.path.splitext(f) + if _ext not in [".py"]: + continue + _f = os.path.join(root, _f) + _f = os.path.relpath(_f, basedir) + _f = "{}.{}".format(_prefix, _f.replace(os.sep, ".")) + if any(fnmatch.fnmatch(_f, x) for x in excludes): + continue + res.add(_f) + return list(res) + + setup( name="GitPython", cmdclass={'build_py': build_py, 'sdist': sdist}, @@ -74,9 +93,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('.'), - py_modules=['git.' + f[:-3] for f in os.listdir('./git') if f.endswith('.py')], - package_data={'git.test': ['fixtures/*']}, + packages=find_packages(exclude=("test.*")), + include_package_data=True, + py_modules=build_py_modules("./git", excludes=["git.ext.*"]), package_dir={'git': 'git'}, python_requires='>=3.4', install_requires=requirements, From 7e7045c4a2b2438adecd2ba59615fbb61d014512 Mon Sep 17 00:00:00 2001 From: Konrad Weihmann Date: Fri, 10 Jul 2020 18:59:01 +0200 Subject: [PATCH 3/5] MANIFEST.in: update to exclude tests and remove all previously used test related settings Signed-off-by: Konrad Weihmann --- MANIFEST.in | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/MANIFEST.in b/MANIFEST.in index e6bf5249c..5fd771db3 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -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 From 961539ced52c82519767a4c9e5852dbeccfc974e Mon Sep 17 00:00:00 2001 From: Konrad Weihmann Date: Fri, 10 Jul 2020 18:59:52 +0200 Subject: [PATCH 4/5] tools: update tool scripts after moving tests Signed-off-by: Konrad Weihmann --- .deepsource.toml | 2 +- .gitattributes | 2 +- .github/workflows/pythonpackage.yml | 2 +- .travis.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.deepsource.toml b/.deepsource.toml index 6e2f9d921..d55288b87 100644 --- a/.deepsource.toml +++ b/.deepsource.toml @@ -1,7 +1,7 @@ version = 1 test_patterns = [ - 'git/test/**/test_*.py' + 'test/**/test_*.py' ] exclude_patterns = [ diff --git a/.gitattributes b/.gitattributes index 872b8eb4f..6d2618f2f 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,2 +1,2 @@ -git/test/fixtures/* eol=lf +test/fixtures/* eol=lf init-tests-after-clone.sh diff --git a/.github/workflows/pythonpackage.yml b/.github/workflows/pythonpackage.yml index b52cb74be..a4f765220 100644 --- a/.github/workflows/pythonpackage.yml +++ b/.github/workflows/pythonpackage.yml @@ -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 diff --git a/.travis.yml b/.travis.yml index 9cbd94a80..1fbb1ddb8 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 From e0b10d965d6377c409ceb40eb47379d79c3fef9f Mon Sep 17 00:00:00 2001 From: Konrad Weihmann Date: Sun, 12 Jul 2020 15:05:33 +0200 Subject: [PATCH 5/5] test: add installation test which installs the current codebase in a venv and runs 'import git' to test if codebase can be installed properly. This adds virtualenv to the test requirements Signed-off-by: Konrad Weihmann --- test-requirements.txt | 1 + test/test_installation.py | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 test/test_installation.py diff --git a/test-requirements.txt b/test-requirements.txt index 574c21f0d..a85eb683e 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -2,3 +2,4 @@ ddt>=1.1.1 coverage flake8 tox +virtualenv diff --git a/test/test_installation.py b/test/test_installation.py new file mode 100644 index 000000000..db14bc846 --- /dev/null +++ b/test/test_installation.py @@ -0,0 +1,29 @@ +# This module is part of GitPython and is released under +# the BSD License: http://www.opensource.org/licenses/bsd-license.php + +import os +import subprocess +from test.lib import TestBase +from test.lib.helper import with_rw_directory + + +class TestInstallation(TestBase): + def setUp_venv(self, rw_dir): + self.venv = rw_dir + subprocess.run(['virtualenv', self.venv], stdout=subprocess.PIPE) + self.python = os.path.join(self.venv, 'bin/python3') + self.pip = os.path.join(self.venv, 'bin/pip3') + self.sources = os.path.join(self.venv, "src") + self.cwd = os.path.dirname(os.path.dirname(__file__)) + os.symlink(self.cwd, self.sources, target_is_directory=True) + + @with_rw_directory + def test_installation(self, rw_dir): + self.setUp_venv(rw_dir) + result = subprocess.run([self.pip, 'install', '-r', 'requirements.txt'], + stdout=subprocess.PIPE, cwd=self.sources) + self.assertEqual(0, result.returncode, msg=result.stderr or result.stdout or "Can't install requirements") + result = subprocess.run([self.python, 'setup.py', 'install'], stdout=subprocess.PIPE, cwd=self.sources) + self.assertEqual(0, result.returncode, msg=result.stderr or result.stdout or "Can't build - setup.py failed") + result = subprocess.run([self.python, '-c', 'import git'], stdout=subprocess.PIPE, cwd=self.sources) + self.assertEqual(0, result.returncode, msg=result.stderr or result.stdout or "Selftest failed")