Skip to content
Snippets Groups Projects
Commit 356d9567 authored by Paul McCarthy's avatar Paul McCarthy :mountain_bicyclist:
Browse files

Merge branch 'mnt/pyfeeds-env-var' into 'master'

MNT: Set a `PYFEEDS_TESTING` environment variable so `feedsRun` scripts can determine whether they are being called by `pyfeeds`, or by other means.

See merge request !37
parents 54517591 bc881736
No related branches found
No related tags found
1 merge request!37MNT: Set a `PYFEEDS_TESTING` environment variable so `feedsRun` scripts can determine whether they are being called by `pyfeeds`, or by other means.
Pipeline #22296 passed
...@@ -2,6 +2,13 @@ ...@@ -2,6 +2,13 @@
===================== =====================
0.12.4 (Thursday 18th January 2024)
-----------------------------------
* Pyfeeds now sets a ``PYFEEDS_TESTING=1`` environment variable when calling
`feedsRun` scripts.
0.12.3 (Friday 8th December 2023) 0.12.3 (Friday 8th December 2023)
--------------------------------- ---------------------------------
......
...@@ -227,6 +227,12 @@ A `pyfeeds` test is called with three parameters: ...@@ -227,6 +227,12 @@ A `pyfeeds` test is called with three parameters:
previously-generated benchmark data for the test, if it exists. previously-generated benchmark data for the test, if it exists.
When `pyfeeds` calls a `feedsRun` script, it sets an environment variable -
`PYFEEDS_TESTING=1`. This may be useful for `feedsRun` scripts which are intended
to be callable both from `pyfeeds`, and through other means, and which need to
behave differently depending on how they are called.
## Writing your test in Python ## Writing your test in Python
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
# Author: Paul McCarthy <pauldmccarthy@gmail.com> # Author: Paul McCarthy <pauldmccarthy@gmail.com>
# #
__version__ = '0.12.3' __version__ = '0.12.4'
"""The pyfeeds version number. """ """The pyfeeds version number. """
......
...@@ -450,6 +450,11 @@ def runTests(pyf): ...@@ -450,6 +450,11 @@ def runTests(pyf):
env = os.environ.copy() env = os.environ.copy()
env['PYTHONPATH'] = op.pathsep.join([thisDir, env.get('PYTHONPATH', '')]) env['PYTHONPATH'] = op.pathsep.join([thisDir, env.get('PYTHONPATH', '')])
# set PYFEEDS_TESTING=1 in case test scripts
# want to know whether they are being executed
# by pyfeeds or via some other mechanism.
env['PYFEEDS_TESTING'] = '1'
# For each test we store a dictionary containing # For each test we store a dictionary containing
# the results of running the test. Each result # the results of running the test. Each result
# dict contains: # dict contains:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment