tests: lazy tpi imports, ignore deprecation warning from setuptools (#9362)

This commit is contained in:
skshetry
2023-04-24 21:34:07 +05:45
committed by GitHub
parent b6d8c07d4d
commit e1bf418e72
2 changed files with 6 additions and 1 deletions
+2
View File
@@ -149,6 +149,8 @@ filterwarnings = [
# and https://github.com/celery/celery/issues/7528
# drop when celery==5.3 && kombu==5.3 releases
"ignore:SelectableGroups dict interface is deprecated:DeprecationWarning",
# tpi imports pkg_resources
"ignore:pkg_resources is deprecated as an API:DeprecationWarning",
# see https://github.com/networkx/networkx/issues/5723.
"ignore:nx.nx_pydot.* depends on the pydot package, which has.*known issues and is not actively maintained:DeprecationWarning",
# remove when new version of pytest-cov gets released
+4 -1
View File
@@ -2,7 +2,6 @@ import os
import textwrap
import pytest
import tpi
from dvc.cli import main
from dvc.ui import ui
@@ -109,6 +108,8 @@ def test_machine_list(tmp_dir, dvc, capsys):
def test_machine_rename_success(tmp_dir, scm, dvc, machine_config, capsys, mocker):
import tpi
config_file = tmp_dir / ".dvc" / "config"
mocker.patch.object(
@@ -147,6 +148,8 @@ def test_machine_rename_exist(tmp_dir, scm, dvc, caplog):
def test_machine_rename_error(tmp_dir, scm, dvc, machine_config, caplog, mocker):
import tpi
config_file = tmp_dir / ".dvc" / "config"
os.makedirs(tmp_dir / ".dvc" / "tmp" / "machine" / "terraform" / "foo")