jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/702900 )
Change subject: [doc] Add user-config.py.sample to sphinx doc
......................................................................
[doc] Add user-config.py.sample to sphinx doc
Change-Id: I8392adda91440361c9d8c8d45c7c270316ee11b8
---
M README.rst
M docs/installation.rst
2 files changed, 13 insertions(+), 2 deletions(-)
Approvals:
JJMC89: Looks good to me, approved
jenkins-bot: Verified
diff --git a/README.rst b/README.rst
index d23d3eb..5bb3aee 100644
--- a/README.rst
+++ b/README.rst
@@ -142,8 +142,6 @@
main()
--------------------------------------------------------------------------------------------
-
For more documentation on Pywikibot see our `docs <https://doc.wikimedia.org/pywikibot/>`_.
diff --git a/docs/installation.rst b/docs/installation.rst
index 4089a5b..74ba2f5 100644
--- a/docs/installation.rst
+++ b/docs/installation.rst
@@ -4,6 +4,19 @@
.. include:: ../README.rst
:end-before: For more documentation on Pywikibot
+Settings
+--------
+
+It is recommended to create a `user-config.py` file if Pywikibot is used as a
+site package. If Pywikibot is used in directory mode e.g. from a repository
+the configuration file is mandatory. A minimal sample is shown below.
+
+.. literalinclude:: ../user-config.py.sample
+
+This sample is shipped with the repository but is not available with
+the site-package. For more settings use :mod:`generate_user_files` script
+(not available with site-package) or refer :mod:`pywikibot.config`.
+
.. note::
Please also see the documentation at
`Manual:Pywikibot/Installation <https://www.mediawiki.org/wiki/Manual:Pywikibot/Installation>`_
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/702900
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I8392adda91440361c9d8c8d45c7c270316ee11b8
Gerrit-Change-Number: 702900
Gerrit-PatchSet: 2
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: JJMC89 <JJMC89.Wikimedia(a)gmail.com>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged
Xqt has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/703216 )
Change subject: [tests] Test header with fetch
......................................................................
[tests] Test header with fetch
Also use context manager to close the session, available since 0.6.0
Change-Id: I76f8c3cef22fe0178a0cd509b9cf05076eb9f781
---
M tests/http_tests.py
1 file changed, 5 insertions(+), 6 deletions(-)
Approvals:
Xqt: Verified; Looks good to me, approved
diff --git a/tests/http_tests.py b/tests/http_tests.py
index 2bd4256..b346ceb 100644
--- a/tests/http_tests.py
+++ b/tests/http_tests.py
@@ -516,18 +516,17 @@
def test_requests(self):
"""Test with requests, underlying package."""
- s = requests.Session()
- r = s.get(self.url)
+ with requests.Session() as s:
+ r = s.get(self.url)
- self.assertEqual(r.headers['content-type'], 'image/png')
- self.assertEqual(r.content, self.png)
-
- s.close()
+ self.assertEqual(r.headers['content-type'], 'image/png')
+ self.assertEqual(r.content, self.png)
def test_http(self):
"""Test with http, standard http interface for pywikibot."""
r = http.fetch(self.url)
+ self.assertEqual(r.headers['content-type'], 'image/png')
self.assertEqual(r.content, self.png)
--
To view, visit https://gerrit.wikimedia.org/r/c/pywikibot/core/+/703216
To unsubscribe, or for help writing mail filters, visit https://gerrit.wikimedia.org/r/settings
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I76f8c3cef22fe0178a0cd509b9cf05076eb9f781
Gerrit-Change-Number: 703216
Gerrit-PatchSet: 1
Gerrit-Owner: Xqt <info(a)gno.de>
Gerrit-Reviewer: Xqt <info(a)gno.de>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged