From 5f8d39c196423c90e91d611fb75a6f6142858614 Mon Sep 17 00:00:00 2001 From: Alexander Schepanovski Date: Tue, 25 Feb 2020 13:44:14 +0700 Subject: [PATCH] test: check that no remote backend modules are loaded by default --- tests/unit/test_imports.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 tests/unit/test_imports.py diff --git a/tests/unit/test_imports.py b/tests/unit/test_imports.py new file mode 100644 index 0000000000..12ff4250f1 --- /dev/null +++ b/tests/unit/test_imports.py @@ -0,0 +1,19 @@ +import subprocess + + +def test_no_remote_imports(): + remote_modules = { + "boto3", + "botocore", + "google.cloud.storage", + "azure.storage.blob", + "oss2", + "pydrive2", + "paramiko", + "pyarrow", + } + + code = "import dvc.main, sys; print(' '.join(sys.modules))" + res = subprocess.run(["python", "-c", code], stdout=subprocess.PIPE) + modules = res.stdout.decode().split() + assert not set(modules) & remote_modules