summaryrefslogtreecommitdiff
path: root/app-admin/ansible-lint/files/ansible-lint-6.8.1_test-module-check.patch
blob: 8c2ca1a96503e7157a1fa80dc8257029aaa7cd19 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
--- a/conftest.py
+++ b/conftest.py
@@ -8,40 +8,6 @@
 import pytest
 from ansible.module_utils.common.yaml import HAS_LIBYAML
 
-# checking if user is running pytest without installing test dependencies:
-missing = []
-for module in ["ansible", "black", "flake8", "flaky", "mypy", "pylint"]:
-    if not importlib.util.find_spec(module):
-        missing.append(module)
-if missing:
-    print(
-        f"FATAL: Missing modules: {', '.join(missing)} -- probably you missed installing test requirements with: pip install -e '.[test]'",
-        file=sys.stderr,
-    )
-    sys.exit(1)
-# we need to be sure that we have the requirements installed as some tests
-# might depend on these.
-try:
-    subprocess.check_output(
-        ["ansible-galaxy", "collection", "install", "-r", "requirements.yml"],
-        stderr=subprocess.PIPE,
-        text=True,
-    )
-except subprocess.CalledProcessError as exc:
-    print(f"{exc}\n{exc.stderr}\n{exc.stdout}", file=sys.stderr)
-    sys.exit(1)
-
-if not HAS_LIBYAML and sys.version_info >= (3, 9, 0):
-    # While presence of libyaml is not required for runtime, we keep this error
-    # fatal here in order to be sure that we spot libyaml errors during testing.
-    #
-    # For 3.8.x we do not do this check, as libyaml does not have an arm64 build for py38.
-    print(
-        "FATAL: For testing, we require pyyaml to be installed with its native extension, missing it would make testing 3x slower and risk missing essential bugs.",
-        file=sys.stderr,
-    )
-    sys.exit(1)
-
 
 os.environ["NO_COLOR"] = "1"