summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES.rst11
-rw-r--r--tests/test_paster.py1
2 files changed, 12 insertions, 0 deletions
diff --git a/CHANGES.rst b/CHANGES.rst
index 46f7fbc18..a717c5b59 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -11,6 +11,17 @@ Features
- Coverage reports in tests based on Python 3.11 instead of Python 3.8.
+- All scripts now pass a new option ``__script__`` when loading the WSGI app.
+ For example, ``pserve`` sets ``__script__ == 'pserve'``. This works for
+ ``pserve``, ``pshell``, ``prequest``, ``proutes``, ``ptweens``, ``pviews``,
+ as well as when using ``pyramid.paster.bootstrap`` directly.
+
+ When using ``plaster-pastedeploy`` to load an INI file, this option will
+ manifest as a new value passed into the ``global_conf`` arg of your
+ application factory, where you can use it as part of initializing your app.
+
+ See https://github.com/Pylons/pyramid/pull/3735
+
Bug Fixes
---------
diff --git a/tests/test_paster.py b/tests/test_paster.py
index 09e3bb868..e787e6973 100644
--- a/tests/test_paster.py
+++ b/tests/test_paster.py
@@ -159,6 +159,7 @@ class Test_bootstrap(unittest.TestCase):
result = self._callFUT('/foo/bar/myapp.ini', request)
self.assertEqual(result['app'], self.app)
self.assertEqual(result['root'], self.root)
+ self.assertEqual(self.get_app.kw['options']['__script__'], 'bootstrap')
self.assertTrue('closer' in result)