8000 feat: add Samples section to CONTRIBUTING.rst (#195) · googleapis/python-datastore@f607fb5 · GitHub
[go: up one dir, main page]

8000
Skip to content

Commit f607fb5

Browse files
feat: add Samples section to CONTRIBUTING.rst (#195)
Source-Link: googleapis/synthtool@52e4e46 Post-Processor: gcr.io/repo-automation-bots/owlbot-python:latest@sha256:6186535cbdbf6b9fe61f00294929221d060634dae4a0795c1cefdbc995b2d605
1 parent b62354e commit f607fb5

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

.github/.OwlBot.lock.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
docker:
22
image: gcr.io/repo-automation-bots/owlbot-python:latest
3-
digest: sha256:5ff7446edeaede81c3ed58b23a4e76a5403fba1350ce28478045657303b6479d
3+
digest: sha256:6186535cbdbf6b9fe61f00294929221d060634dae4a0795c1cefdbc995b2d605

CONTRIBUTING.rst

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,30 @@ Build the docs via:
202202

203203
$ nox -s docs
204204

205+
*************************
206+
Samples and code snippets
207+
*************************
208+
209+
Code samples and snippets live in the `samples/` catalogue. Feel free to
210+
provide more examples, but make sure to write tests for those examples.
211+
Each folder containing example code requires its own `noxfile.py` script
212+
which automates testing. If you decide to create a new folder, you can
213+
base it on the `samples/snippets` folder (providing `noxfile.py` and
214+
the requirements files).
215+
216+
The tests will run against a real Google Cloud Project, so you should
217+
configure them just like the System Tests.
218+
219+
- To run sample tests, you can execute::
220+
221+
# Run all tests in a folder
222+
$ cd samples/snippets
223+
$ nox -s py-3.8
224+
225+
# Run a single sample test
226+
$ cd samples/snippets
227+
$ nox -s py-3.8 -- -k <name of test>
228+
205229
********************************************
206230
Note About ``README`` as it pertains to PyPI
207231
********************************************

0 commit comments

Comments
 (0)
0