You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by "AnandInguva (via GitHub)" <gi...@apache.org> on 2023/09/09 18:23:16 UTC

[GitHub] [beam] AnandInguva commented on a diff in pull request #28385: Add pyproject.toml

AnandInguva commented on code in PR #28385:
URL: https://github.com/apache/beam/pull/28385#discussion_r1320623562


##########
sdks/python/scripts/run_pytest.sh:
##########
@@ -42,10 +42,10 @@ echo "posargs: $posargs"
 
 # Run with pytest-xdist and without.
 pytest -o junit_suite_name=${envname} \
-  --junitxml=pytest_${envname}.xml -m 'not no_xdist' -n 6 ${pytest_args} --pyargs ${posargs}
+  --junitxml=pytest_${envname}.xml -m 'not no_xdist' -n 6 --import-mode=importlib ${pytest_args} --pyargs ${posargs}

Review Comment:
   Newer projects needs to use importlib. Also using importlib, we are able to use installed version of Apache Beam for testing in tox environments instead of the local source(without this flag installed version gets shadowed by the local source)
   
   https://docs.pytest.org/en/7.1.x/explanation/goodpractices.html#which-import-mode



-- 
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-unsubscribe@beam.apache.org

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