comparison env/lib/python3.9/site-packages/bioblend/_tests/pytest_galaxy_test_wrapper.py @ 0:4f3585e2f14b draft default tip

"planemo upload commit 60cee0fc7c0cda8592644e1aad72851dec82c959"
author shellac
date Mon, 22 Mar 2021 18:12:50 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:4f3585e2f14b
1 #!/usr/bin/env python
2 """Wrapper around pytest to execute the bioblend Galaxy test suite against fixed instance.
3
4 By default all Galaxy tests will run but a smaller subset can be executed by setting
5 the environment variable ``BIOBLEND_TEST_SUITE`` to ``quick``.
6 """
7 import os
8 import sys
9
10 try:
11 import pytest
12 except ImportError:
13 pytest = None
14
15 DIRECTORY = os.path.abspath(os.path.dirname(__file__))
16 BIOBLEND_TEST_SUITE = os.environ.get("BIOBLEND_TEST_SUITE", "full")
17
18 quick_tests = [
19 "TestGalaxyRoles.py",
20 "TestGalaxyRoles.py",
21 "TestGalaxyUsers.py",
22 "TestGalaxyToolData.py",
23 "TestGalaxyTools.py::TestGalaxyTools::test_get_tools", # Test single upload command.
24 ]
25
26
27 def main(args=None):
28 """Entry point that delegates to pytest.main."""
29 if args is None:
30 args = sys.argv[1:]
31 if len(args) < 2:
32 if BIOBLEND_TEST_SUITE == "full":
33 args.append(os.path.join(DIRECTORY))
34 else:
35 for quick_test in quick_tests:
36 args.append(os.path.join(DIRECTORY, quick_test))
37 _pytest_main(args)
38
39
40 def _pytest_main(args):
41 if pytest is None:
42 raise Exception("pytest is required to use this script.")
43 sys.exit(pytest.main(args))
44
45
46 if __name__ == "__main__":
47 main()