diff --git a/requirements.txt b/requirements.txt index 696a24ddd..0eb848d45 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,5 @@ azure-storage-blob==1.3.0 -boto3==1.9.86 +boto3==1.9.115 ply>=3.9 # See https://github.com/pyinstaller/pyinstaller/issues/1945 configparser>=3.5.0 zc.lockfile>=1.2.1 diff --git a/setup.py b/setup.py index b0a635ce0..ce656dabd 100644 --- a/setup.py +++ b/setup.py @@ -26,7 +26,7 @@ install_requires = [ # Extra dependencies for remote integrations gs = ["google-cloud-storage==1.13.0"] -s3 = ["boto3==1.7.4"] +s3 = ["boto3==1.9.115"] azure = ["azure-storage-blob==1.3.0"] ssh = ["paramiko>=2.4.1"] all_remotes = gs + s3 + azure + ssh diff --git a/tests/__main__.py b/tests/__main__.py index 0ecaec323..9e7f03d86 100644 --- a/tests/__main__.py +++ b/tests/__main__.py @@ -13,18 +13,11 @@ os.putenv("DVC_HOME", REPO_ROOT) os.putenv("DVC_TEST", "true") if len(sys.argv) == 1: - scope = "--all-modules" + params = "" else: - scope = " ".join(sys.argv[1:]) + params = " ".join(sys.argv[1:]) -cmd = ( - "nosetests -v --processes=4 --process-timeout=600 --cover-inclusive " - "--cover-erase --cover-package=dvc --with-coverage --with-flaky " - "--logging-clear-handlers " - # --exe ensures tests are executed even if they have exec permissions set - # and owned by root:root as they do when running in Windows Subsystem for - # Linux (WSL). - "--exe " - "{scope} ".format(scope=scope) +cmd = "py.test -v -n=4 --timeout=600 --cov=dvc " "{params} ".format( + params=params ) check_call(cmd, shell=True) diff --git a/tests/requirements.txt b/tests/requirements.txt index c17e1da20..66b48ba4c 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -1,11 +1,11 @@ pytest>=3.3.1 -nose>=1.3.7 +pytest-timeout>=1.3.3 +pytest-cov>=2.6.1 +pytest-xdist>=1.26.1 flaky>=3.5.3 mock>=2.0.0 -coverage>=4.5.1 -codecov>=2.0.15 xmltodict>=0.11.0 -awscli>=1.14.18 +awscli>=1.16.125 google-compute-engine pywin32; sys_platform == 'win32' Pygments # required by collective.checkdocs diff --git a/tests/test_checkout.py b/tests/test_checkout.py index 23c0918f6..d1a2b5dc7 100644 --- a/tests/test_checkout.py +++ b/tests/test_checkout.py @@ -356,7 +356,7 @@ class TestCheckoutDirectory(TestRepro): class TestCheckoutHook(TestDvc): @mock.patch("sys.stdout.isatty", return_value=True) - @mock.patch("dvc.utils.compat.input", side_effect=EOFError) + @mock.patch("dvc.prompt.input", side_effect=EOFError) def test(self, mock_input, mock_isatty): """ Test that dvc checkout handles EOFError gracefully, which is what it will experience when running in a git hook. diff --git a/tests/unit/command/commit.py b/tests/unit/command/__init__.py similarity index 100% rename from tests/unit/command/commit.py rename to tests/unit/command/__init__.py diff --git a/tests/unit/command/test_commit.py b/tests/unit/command/test_commit.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/unit/command/run.py b/tests/unit/command/test_run.py similarity index 100% rename from tests/unit/command/run.py rename to tests/unit/command/test_run.py diff --git a/tests/unit/dependency/gs.py b/tests/unit/dependency/test_gs.py similarity index 68% rename from tests/unit/dependency/gs.py rename to tests/unit/dependency/test_gs.py index e363a0c2d..5eba2b75c 100644 --- a/tests/unit/dependency/gs.py +++ b/tests/unit/dependency/test_gs.py @@ -1,6 +1,6 @@ from dvc.dependency.gs import DependencyGS -from tests.unit.dependency.local import TestDependencyLOCAL +from tests.unit.dependency.test_local import TestDependencyLOCAL class TestDependencyGS(TestDependencyLOCAL): diff --git a/tests/unit/dependency/hdfs.py b/tests/unit/dependency/test_hdfs.py similarity index 69% rename from tests/unit/dependency/hdfs.py rename to tests/unit/dependency/test_hdfs.py index 0261b0403..8362381ba 100644 --- a/tests/unit/dependency/hdfs.py +++ b/tests/unit/dependency/test_hdfs.py @@ -1,6 +1,6 @@ from dvc.dependency.hdfs import DependencyHDFS -from tests.unit.dependency.local import TestDependencyLOCAL +from tests.unit.dependency.test_local import TestDependencyLOCAL class TestDependencyHDFS(TestDependencyLOCAL): diff --git a/tests/unit/dependency/http.py b/tests/unit/dependency/test_http.py similarity index 69% rename from tests/unit/dependency/http.py rename to tests/unit/dependency/test_http.py index 582ef0e62..b8d1c2c4c 100644 --- a/tests/unit/dependency/http.py +++ b/tests/unit/dependency/test_http.py @@ -1,6 +1,6 @@ from dvc.dependency.http import DependencyHTTP -from tests.unit.dependency.local import TestDependencyLOCAL +from tests.unit.dependency.test_local import TestDependencyLOCAL class TestDependencyHTTP(TestDependencyLOCAL): diff --git a/tests/unit/dependency/local.py b/tests/unit/dependency/test_local.py similarity index 100% rename from tests/unit/dependency/local.py rename to tests/unit/dependency/test_local.py diff --git a/tests/unit/dependency/s3.py b/tests/unit/dependency/test_s3.py similarity index 68% rename from tests/unit/dependency/s3.py rename to tests/unit/dependency/test_s3.py index 48096a851..4dcf49e80 100644 --- a/tests/unit/dependency/s3.py +++ b/tests/unit/dependency/test_s3.py @@ -1,6 +1,6 @@ from dvc.dependency.s3 import DependencyS3 -from tests.unit.dependency.local import TestDependencyLOCAL +from tests.unit.dependency.test_local import TestDependencyLOCAL class TestDependencyS3(TestDependencyLOCAL): diff --git a/tests/unit/dependency/ssh.py b/tests/unit/dependency/test_ssh.py similarity index 69% rename from tests/unit/dependency/ssh.py rename to tests/unit/dependency/test_ssh.py index ef9ae5a2c..c9fbf1984 100644 --- a/tests/unit/dependency/ssh.py +++ b/tests/unit/dependency/test_ssh.py @@ -1,6 +1,6 @@ from dvc.dependency.ssh import DependencySSH -from tests.unit.dependency.local import TestDependencyLOCAL +from tests.unit.dependency.test_local import TestDependencyLOCAL class TestDependencySSH(TestDependencyLOCAL): diff --git a/tests/unit/output/gs.py b/tests/unit/output/test_gs.py similarity index 68% rename from tests/unit/output/gs.py rename to tests/unit/output/test_gs.py index ce3d5590e..7682d71a2 100644 --- a/tests/unit/output/gs.py +++ b/tests/unit/output/test_gs.py @@ -1,6 +1,6 @@ from dvc.output.gs import OutputGS -from tests.unit.output.local import TestOutputLOCAL +from tests.unit.output.test_local import TestOutputLOCAL class TestOutputGS(TestOutputLOCAL): diff --git a/tests/unit/output/hdfs.py b/tests/unit/output/test_hdfs.py similarity index 69% rename from tests/unit/output/hdfs.py rename to tests/unit/output/test_hdfs.py index b1191accd..039711260 100644 --- a/tests/unit/output/hdfs.py +++ b/tests/unit/output/test_hdfs.py @@ -1,6 +1,6 @@ from dvc.output.hdfs import OutputHDFS -from tests.unit.output.local import TestOutputLOCAL +from tests.unit.output.test_local import TestOutputLOCAL class TestOutputHDFS(TestOutputLOCAL): diff --git a/tests/unit/output/local.py b/tests/unit/output/test_local.py similarity index 100% rename from tests/unit/output/local.py rename to tests/unit/output/test_local.py diff --git a/tests/unit/output/s3.py b/tests/unit/output/test_s3.py similarity index 68% rename from tests/unit/output/s3.py rename to tests/unit/output/test_s3.py index 975945107..1c48c5eae 100644 --- a/tests/unit/output/s3.py +++ b/tests/unit/output/test_s3.py @@ -1,6 +1,6 @@ from dvc.output.s3 import OutputS3 -from tests.unit.output.local import TestOutputLOCAL +from tests.unit.output.test_local import TestOutputLOCAL class TestOutputS3(TestOutputLOCAL): diff --git a/tests/unit/output/ssh.py b/tests/unit/output/test_ssh.py similarity index 69% rename from tests/unit/output/ssh.py rename to tests/unit/output/test_ssh.py index cd21297d8..cd91d0280 100644 --- a/tests/unit/output/ssh.py +++ b/tests/unit/output/test_ssh.py @@ -1,6 +1,6 @@ from dvc.output.ssh import OutputSSH -from tests.unit.output.local import TestOutputLOCAL +from tests.unit.output.test_local import TestOutputLOCAL class TestOutputSSH(TestOutputLOCAL): diff --git a/tests/unit/remote/ssh/__init__.py b/tests/unit/remote/ssh/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/unit/remote/ssh.py b/tests/unit/remote/ssh/test_ssh.py similarity index 100% rename from tests/unit/remote/ssh.py rename to tests/unit/remote/ssh/test_ssh.py diff --git a/tests/unit/remote/azure.py b/tests/unit/remote/test_azure.py similarity index 100% rename from tests/unit/remote/azure.py rename to tests/unit/remote/test_azure.py diff --git a/tests/unit/remote/base.py b/tests/unit/remote/test_base.py similarity index 100% rename from tests/unit/remote/base.py rename to tests/unit/remote/test_base.py diff --git a/tests/unit/remote/gs.py b/tests/unit/remote/test_gs.py similarity index 100% rename from tests/unit/remote/gs.py rename to tests/unit/remote/test_gs.py diff --git a/tests/unit/scm/git.py b/tests/unit/scm/test_git.py similarity index 100% rename from tests/unit/scm/git.py rename to tests/unit/scm/test_git.py diff --git a/tests/unit/scm/scm.py b/tests/unit/scm/test_scm.py similarity index 100% rename from tests/unit/scm/scm.py rename to tests/unit/scm/test_scm.py diff --git a/tests/unit/daemon.py b/tests/unit/test_daemon.py similarity index 100% rename from tests/unit/daemon.py rename to tests/unit/test_daemon.py diff --git a/tests/unit/progress.py b/tests/unit/test_progress.py similarity index 100% rename from tests/unit/progress.py rename to tests/unit/test_progress.py diff --git a/tests/unit/prompt.py b/tests/unit/test_prompt.py similarity index 100% rename from tests/unit/prompt.py rename to tests/unit/test_prompt.py diff --git a/tests/unit/repo.py b/tests/unit/test_repo.py similarity index 100% rename from tests/unit/repo.py rename to tests/unit/test_repo.py diff --git a/tests/unit/stage.py b/tests/unit/test_stage.py similarity index 100% rename from tests/unit/stage.py rename to tests/unit/test_stage.py diff --git a/tests/unit/updater.py b/tests/unit/test_updater.py similarity index 100% rename from tests/unit/updater.py rename to tests/unit/test_updater.py diff --git a/tests/unit/utils/__init__.py b/tests/unit/utils/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/tests/unit/utils/fs.py b/tests/unit/utils/test_fs.py similarity index 91% rename from tests/unit/utils/fs.py rename to tests/unit/utils/test_fs.py index 79caceb80..109422715 100644 --- a/tests/unit/utils/fs.py +++ b/tests/unit/utils/test_fs.py @@ -56,19 +56,24 @@ class TestContainsLink(TestCase): def test_should_return_false_on_no_more_dirs_below_path( self, dirname_patch, _ ): - self.assertFalse(contains_symlink_up_to("path")) + self.assertFalse( + contains_symlink_up_to(os.path.join("foo", "path"), "foo") + ) dirname_patch.assert_called_once() @patch.object(System, "is_symlink", return_value=False) - @patch.object(os.path, "dirname", return_value="") - def test_should_call_recursive_on_no_condition_matched(self, _, __): + def test_should_call_recursive_on_no_condition_matched(self, _): contains_symlink_spy = spy(contains_symlink_up_to) with patch.object( dvc.utils.fs, "contains_symlink_up_to", contains_symlink_spy ): # call from full path to match contains_symlink_spy patch path - self.assertFalse(dvc.utils.fs.contains_symlink_up_to("path")) + self.assertFalse( + dvc.utils.fs.contains_symlink_up_to( + os.path.join("foo", "path"), "foo" + ) + ) self.assertEqual(2, contains_symlink_spy.mock.call_count) @patch.object(System, "is_symlink", return_value=True)