#1267 Document %{py3_test_envvars}
Merged a year ago by tibbs. Opened a year ago by churchyard.
churchyard/packaging-committee py3_test_envvars  into  master

@@ -1086,8 +1086,30 @@ 

  * Locations in the buildroot are added to `+$PATH+` and `+$PYTHONPATH+`.

  * `+$PYTHONDONTWRITEBYTECODE+` is set to avoid

  writing pytest-specific cache files to buildroot

+ * `+$PYTEST_XDIST_AUTO_NUM_WORKERS+` is set to `+%{_smp_build_ncpus}+`

  * If unset, `+$CFLAGS+` and `+$LDFLAGS+` are set to match the build flags

  

+ ==== Other test runners

+ 

+ If upstream doesn’t use `+tox+` or `+pytest+`,

+ other test runners can be invoked with <<py3_test_envvars,the `+%{py3_test_envvars}+`>> macro,

+ available since Fedora Linux 38.

+ 

+ This macro sets several environment variables similarly to `+%pytest+`,

+ but requires the actual test runner to be invoked after the macro, for example:

+ 

+ [source,spec]

+ ----

+ %{py3_test_envvars} %{python3} -m unittest

+ ----

+ 

+ Or:

+ 

+ [source,spec]

+ ----

+ %{py3_test_envvars} %{python3} tests/run_tests.py

+ ----

+ 

  === Test dependencies

  

  One part of the Python packaging ecosystem that is still not standardized
@@ -1563,6 +1585,14 @@ 

  +

  The command that `+%pytest+` uses. May be redefined.

  

+ [#py3_test_envvars]

+ * `+%py3_test_envvars+` (`+PATH=... PYTHONPATH=... PYTHONDONTWRITEBYTECODE=1 ...+`)

+ +

+ The environment variables used by `+%pytest+` and `+%tox+`.

+ It may be used to invoke custom test runners in `+%check+`.

+ See <<Other test runners>> for details.

+ Introduced in Fedora Linux 38.

+ 

  [#py3_check_import]

  * `+%py3_check_import+`

  +

no initial comment

Pull-Request has been merged by tibbs

a year ago
Metadata