Skip to content

Commit a568604

Browse files
authored
Merge pull request #6738 from chrisburr/test-entrypoints
[v7r3] Ensure all entrypoints are importable
2 parents 32ea4b4 + ff8ee5a commit a568604

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import importlib_metadata as metadata
2+
import pytest
3+
import six
4+
5+
6+
@pytest.mark.skipif(six.PY2, reason="Only makes sense for Python 3 installs")
7+
def test_entrypoints():
8+
"""Make sure all console_scripts defined by DIRAC are importable."""
9+
errors = []
10+
for ep in metadata.entry_points(group="console_scripts"): # pylint: disable=unexpected-keyword-arg
11+
if ep.module.startswith("DIRAC"):
12+
try:
13+
ep.load()
14+
except ModuleNotFoundError as e: # pylint: disable=undefined-variable
15+
errors.append(str(e))
16+
assert not errors, errors

0 commit comments

Comments
 (0)