From 36b627612483331f96b0f7490d9b3d6322c5dd6a Mon Sep 17 00:00:00 2001 From: Maico Timmerman Date: Fri, 30 Apr 2021 16:36:23 +0200 Subject: mypy: load extra test files from environment variable Add --mypy-extra-test-path parameter to pytest execution to list extra directories to load test files from. This enables the stubs repo to load this plugin and specify it's own test directory to run mypy tests. Supports both single file tests and incremental tests based on patch files. Change-Id: Id6424ff15b2f527183b9713384df3d625a8e6eb8 --- lib/sqlalchemy/testing/plugin/plugin_base.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'lib/sqlalchemy/testing/plugin/plugin_base.py') diff --git a/lib/sqlalchemy/testing/plugin/plugin_base.py b/lib/sqlalchemy/testing/plugin/plugin_base.py index 6370d7ce9..492a3224d 100644 --- a/lib/sqlalchemy/testing/plugin/plugin_base.py +++ b/lib/sqlalchemy/testing/plugin/plugin_base.py @@ -226,6 +226,15 @@ def setup_options(make_option): dest="dump_pyannotate", help="Run pyannotate and dump json info to given file", ) + make_option( + "--mypy-extra-test-path", + type=str, + action="append", + default=[], + dest="mypy_extra_test_paths", + help="Additional test directories to add to the mypy tests. " + "This is used only when running mypy tests. Multiple OK", + ) def configure_follower(follower_ident): -- cgit v1.2.1