This is an automated email from the ASF dual-hosted git repository.

uranusjr pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new 26b5bc9801 Add type annotations to `conftest.py` (#38691)
26b5bc9801 is described below

commit 26b5bc9801e599d47b2307c8d0e8df2cfd4363e7
Author: Syed Hussain <103602455+syeda...@users.noreply.github.com>
AuthorDate: Tue Apr 2 16:37:12 2024 -0700

    Add type annotations to `conftest.py` (#38691)
---
 tests/system/conftest.py | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/tests/system/conftest.py b/tests/system/conftest.py
index ab63d85566..3c75021d8b 100644
--- a/tests/system/conftest.py
+++ b/tests/system/conftest.py
@@ -19,7 +19,6 @@ from __future__ import annotations
 import itertools
 import os
 import re
-from pathlib import Path
 from unittest import mock
 
 import pytest
@@ -40,18 +39,18 @@ def provider_env_vars():
 
 
 @pytest.fixture(autouse=True)
-def skip_if_env_var_not_set(provider_env_vars):
+def skip_if_env_var_not_set(provider_env_vars: list[str]) -> None:
     for env in itertools.chain(REQUIRED_ENV_VARS, provider_env_vars):
         if env not in os.environ:
             pytest.skip(f"Missing required environment variable {env}")
             return
 
 
-def pytest_collection_modifyitems(config, items):
+def pytest_collection_modifyitems(config: pytest.Config, items: 
list[pytest.Item]) -> None:
     """Add @pytest.mark.system(provider_name) for every system test."""
-    rootdir = Path(config.rootpath)
+    rootdir = config.rootpath
     for item in items:
-        rel_path = Path(item.path).relative_to(rootdir)
+        rel_path = item.path.relative_to(rootdir)
         match = re.match(".+/system/providers/([^/]+)", str(rel_path))
         if match:
             provider = match.group(1)

Reply via email to