New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
tests: refactor systests to use pytest fixtures / idioms #210
Conversation
…dule Use pytest fixtures / idioms, rather than legacy setup / teardown. Toward #208.
Use pytest fixtures / idioms. Toward #208.
Use pytest fixtures / idioms. Toward #208.
...to all DRYing ouf related system tests.
Use pytest fixtures / idioms. Toward #200.
Remaining 'Config.CLIENT' and 'Config.TO_DELETE' left for consumption by doctests.
We aren't running the doctests any longer, and we should be using pytest-doctest integration to leverage the systest fixtures.
|
||
query = client.query(kind='_Doctest') | ||
cursor = None | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note to reviewers: I've ripped out the bit-rotted doctest setup / teardown code here and below (we haven't had a doctests
session since googleapis/google-cloud-python#6642, 2018-11-28). #209 tracks the need to get the docstring doctests either tested, or else replaced by snippets / samples.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. A few minor nits/questions, but nothing alarming.
|
||
# Smoke test to make sure it doesn't blow up. No return value or | ||
# verifiable side effect to verify. | ||
datastore_client.reserve_ids_sequential(key, num_ids) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you call allocate_ids
and confirm none of the returned ids are in the reserved space?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Heh, that was your comment ("no verifiable side effects") from #76.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LOL. De memory, she is not so good...
…apis/python-datastore into 208-refactor-systest-using-pytest
tests/system/conftest.py
Outdated
|
||
@pytest.fixture(scope="session") | ||
def in_emulator(): | ||
return _helpers.get_emulator_dataset() is not None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated in 57816be
tests/system/conftest.py
Outdated
def datastore_client(test_namespace): | ||
emulator_dataset = _helpers.get_emulator_dataset() | ||
|
||
if emulator_dataset is not None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated in 57816be
|
||
# Smoke test to make sure it doesn't blow up. No return value or | ||
# verifiable side effect to verify. | ||
datastore_client.reserve_ids_sequential(key, num_ids) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Heh, that was your comment ("no verifiable side effects") from #76.
Closes #208.