Uh oh!
There was an error while loading. Please reload this page.
Adding ability to run doctests with datastore system tests. - #2738
Conversation
| def test_it(self): | ||
| from sphinx import application | ||
| docs_dir = self._make_temp_docs() |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
| return docs_dir | ||
| def test_it(self): | ||
| from sphinx import application |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
be9f0dc to
5a5b307Compare5a5b307 to
4e7d49fComparedhermes
commented
Nov 16, 2016
@tseaver PTAL |
dhermes
commented
Nov 18, 2016
@tseaver PTAL |
| def __repr__(self): | ||
| return '<Key%s, project=%s>' % (self.path, self.project) | ||
| return '<Key%s, project=%s>' % (self._flat_path, self.project) | ||
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
| >>> entity['answer'] = 42 | ||
| >>> entity | ||
| <Entity('EntityKind', 1234) {'answer': 42}> | ||
| >>> query = client.query(kind='EntityKind') |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
| super(Entity, self).__repr__()) | ||
| else: | ||
| return '<Entity %s>' % (super(Entity, self).__repr__()) | ||
| return '<Entity %s>' % (super(Entity, self).__repr__(),) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
| self.assertEqual(repr(entity), "<Entity/bar/baz {'foo': 'Foo'}>") | ||
| entity_vals = {'foo': 'Foo'} | ||
| entity.update(entity_vals) | ||
| expected = '<Entity%s %s>' % (flat_path, entity_vals) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
dhermes
commented
Nov 28, 2016
@tseaver Only comments on the doctest itself / associated Any comments on the approach of making a fake docs directory and then running doctest there? |
tseaver
commented
Nov 28, 2016
We're going to need a way to test all the examples, not just those embedded in docstrings: do you have a plan for that? |
tseaver
commented
Nov 29, 2016
@dhermes Memory eludes me: what stops us from just running |
dhermes
commented
Nov 29, 2016
Yes, though that is "beyond" the scope of this PR. There are two possible approaches that I can see. The first is to "guess" which hand-written RST files apply to a given package (I am not "pro" on this approach). The second is as follows:
The synthesized one is an attempt to isolate on a per-package basis (just as is done with the system tests). It's not strictly necessary. The "real" reason I did it was because our docs build takes quite a long time (since the project is so large), and I wanted to have a snappier doctest build. |
dhermes
commented
Nov 29, 2016
@tseaver Can we keep moving on this? |
tseaver
commented
Nov 30, 2016
@dhermes I'd still say that running |
| from google.cloud import datastore | ||
| import os | ||
| os.environ['GOOGLE_CLOUD_PROJECT'] = u'my-project' |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
dhermes
commented
Nov 30, 2016
This is fine, though I see it having two issues:
|
dhermes
commented
Dec 2, 2016
Plan moving forward:
|
tseaver
commented
Dec 2, 2016
LGTM. |
Adding ability to run doctests with datastore system tests.
Adding ability to run doctests with datastore system tests.
Since Travis / CircleCI won't run this by default, here is some sample output: