Run pytest as a module

This commit is contained in:
Ayaz Salikhov
2022-07-04 19:16:06 +04:00
parent 5583aba342
commit 61b20aa69e

View File

@@ -8,7 +8,7 @@ import plumbum
from tests.images_hierarchy import get_test_dirs from tests.images_hierarchy import get_test_dirs
pytest = plumbum.local["pytest"] python3 = plumbum.local["python3"]
LOGGER = logging.getLogger(__name__) LOGGER = logging.getLogger(__name__)
@@ -19,7 +19,9 @@ def test_image(short_image_name: str, owner: str) -> None:
LOGGER.info(f"Test dirs to be run: {test_dirs}") LOGGER.info(f"Test dirs to be run: {test_dirs}")
with plumbum.local.env(TEST_IMAGE=f"{owner}/{short_image_name}"): with plumbum.local.env(TEST_IMAGE=f"{owner}/{short_image_name}"):
( (
pytest[ python3[
"-m",
"pytest",
"--numprocesses", "--numprocesses",
"auto", "auto",
"-m", "-m",
@@ -39,7 +41,7 @@ if __name__ == "__main__":
required=True, required=True,
help="Short image name to run test on", help="Short image name to run test on",
) )
arg_parser.add_argument("--owner", required=True, help="Owner of the image") arg_parser.add_argument("--owner", default="jupyter", help="Owner of the image")
args = arg_parser.parse_args() args = arg_parser.parse_args()