From 85792bca716f5fc24272c5f154937ddd20678144 Mon Sep 17 00:00:00 2001 From: Avasam Date: Sat, 14 Jan 2023 08:38:20 -0500 Subject: [PATCH] Fix stubtest for sqlalchemy.testing.plugin.pytestplugin (#9533) --- stubs/SQLAlchemy/@tests/requirements-stubtest.txt | 1 + stubs/SQLAlchemy/@tests/stubtest_allowlist.txt | 5 +---- .../SQLAlchemy/sqlalchemy/testing/plugin/pytestplugin.pyi | 7 ++----- 3 files changed, 4 insertions(+), 9 deletions(-) create mode 100644 stubs/SQLAlchemy/@tests/requirements-stubtest.txt diff --git a/stubs/SQLAlchemy/@tests/requirements-stubtest.txt b/stubs/SQLAlchemy/@tests/requirements-stubtest.txt new file mode 100644 index 000000000..e079f8a60 --- /dev/null +++ b/stubs/SQLAlchemy/@tests/requirements-stubtest.txt @@ -0,0 +1 @@ +pytest diff --git a/stubs/SQLAlchemy/@tests/stubtest_allowlist.txt b/stubs/SQLAlchemy/@tests/stubtest_allowlist.txt index 2e8769025..21c09df70 100644 --- a/stubs/SQLAlchemy/@tests/stubtest_allowlist.txt +++ b/stubs/SQLAlchemy/@tests/stubtest_allowlist.txt @@ -59,10 +59,7 @@ sqlalchemy.testing.provision.stop_test_class_outside_fixtures sqlalchemy.testing.provision.temp_table_keyword_args sqlalchemy.testing.provision.update_db_opts -# requires other packages -sqlalchemy.testing.plugin.pytestplugin - -# can't be imported +# KeyError/AttributeError on import due to dynamic initialization from a different module sqlalchemy.testing.fixtures sqlalchemy.testing.pickleable sqlalchemy.testing.plugin.bootstrap diff --git a/stubs/SQLAlchemy/sqlalchemy/testing/plugin/pytestplugin.pyi b/stubs/SQLAlchemy/sqlalchemy/testing/plugin/pytestplugin.pyi index ded604f35..bfdd0245e 100644 --- a/stubs/SQLAlchemy/sqlalchemy/testing/plugin/pytestplugin.pyi +++ b/stubs/SQLAlchemy/sqlalchemy/testing/plugin/pytestplugin.pyi @@ -1,9 +1,8 @@ -from typing import Any +from typing_extensions import Final from . import plugin_base -has_xdist: bool -py2k: Any +py2k: Final = False def pytest_addoption(parser) -> None: ... def pytest_configure(config) -> None: ... @@ -14,8 +13,6 @@ def collect_types_fixture() -> None: ... def pytest_sessionstart(session) -> None: ... def pytest_sessionfinish(session) -> None: ... def pytest_collection_finish(session): ... -def pytest_configure_node(node) -> None: ... -def pytest_testnodedown(node, error) -> None: ... def pytest_collection_modifyitems(session, config, items): ... def pytest_pycollect_makeitem(collector, name, obj): ... def pytest_runtest_setup(item) -> None: ...