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

ferruzzi 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 11629f65f1 Fix system-test pytest marker (#32978)
11629f65f1 is described below

commit 11629f65f1efe473ff4842b8e83cb518a1f56a0c
Author: Jarek Potiuk <ja...@potiuk.com>
AuthorDate: Mon Jul 31 22:23:06 2023 +0200

    Fix system-test pytest marker (#32978)
    
    We have an automated system-test pytest marker that applies the
    pytest.mark.system marker to all system tests. It has been implemented
    in a strange way as it was applying the marker to all provider tests
    if the whole "tests" directory was used for test collection.
    
    This caused quarantine tests from providers folder to be skipped
    because they were automatically marked with pytest.mark.system marker.
    
    Also system tests were generally excluded from running after we brought
    back the "test_*" prefix.
    
    This PR updates the auto-marker to only apply system marker to
    tests in "system/providers" folder and adds the "example_*" prefix
    to the prefixes automatically collected by pytest.
---
 pyproject.toml           | 1 +
 tests/system/conftest.py | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/pyproject.toml b/pyproject.toml
index de7dc5a905..630d44cf05 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -103,6 +103,7 @@ filterwarnings = [
 ]
 python_files = [
     "test_*.py",
+    "example_*.py",
 ]
 testpaths = [
     "tests",
diff --git a/tests/system/conftest.py b/tests/system/conftest.py
index 500a41a5c3..154e7c208f 100644
--- a/tests/system/conftest.py
+++ b/tests/system/conftest.py
@@ -52,7 +52,7 @@ def pytest_collection_modifyitems(config, items):
     rootdir = Path(config.rootdir)
     for item in items:
         rel_path = Path(item.fspath).relative_to(rootdir)
-        match = re.match(".+/providers/([^/]+)", str(rel_path))
+        match = re.match(".+/system/providers/([^/]+)", str(rel_path))
         if not match:
             continue
         provider = match.group(1)

Reply via email to