mohamedawnallah commented on code in PR #35655:
URL: https://github.com/apache/beam/pull/35655#discussion_r2222611731


##########
sdks/python/scripts/run_pytest.sh:
##########
@@ -30,22 +30,48 @@ envname=${1?First argument required: suite base name}
 posargs=$2
 pytest_args=$3
 
-if [[ $pytest_args =~ "-m" ]] || [[ $posargs =~ "-m" ]]; then
-  echo "$0 cannot be called with -m as it interferes with 'no_xdist' logic, 
see BEAM-12985."
-  exit 1
-fi
-
 # strip leading/trailing quotes from posargs because it can get double quoted 
as its passed through.
 posargs=$(sed -e 's/^"//' -e 's/"$//' -e "s/'$//" -e "s/^'//" <<<$posargs)
 echo "pytest_args: $pytest_args"
 echo "posargs: $posargs"
 
-# Run with pytest-xdist and without.
+# Define the regex for extracting the -m argument value
+marker_regex="-m\s+('[^']+'|\"[^\"]+\"|[^ ]+)"

Review Comment:
   ## Pytest Marker Regex Visualization
   
   Regular Expression: `-m\s+('[^']+'|\"[^\"]+\"|[^ ]+)`
   
   Visualization:
   <img width="1116" height="630" alt="Screenshot 2025-07-22 at 4 25 50 PM" 
src="https://github.com/user-attachments/assets/cfa73830-509a-4a9f-b522-f8fd6f5a259d";
 />
   
   Reproducibility:
   
https://regexper.com/#-m%5Cs%2B%28'%5B%5E'%5D%2B'%7C%5C%22%5B%5E%5C%22%5D%2B%5C%22%7C%5B%5E%20%5D%2B%29
   
   ## How has this been tested?
   
   Testing Script: 
https://gist.github.com/mohamedawnallah/8c2073d078aa9fd20f9c99f34ee1ba97
   
   
   
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscr...@beam.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to