Uh oh!
There was an error while loading. Please reload this page.
Allow unit tests to pass if pytz is installed. - #1706
Conversation
tseaver
commented
Apr 8, 2016
Thanks for the patch! ISTM that a better fix for the test would be to have it try to import deftest_module_property(self):
fromgcloudimport_helpersasMUTklass=self._getTargetClass()
try:
importpytzexceptImportError:
self.assertTrue(isinstance(MUT.UTC, klass))
else:
self.assertTrue(MUT.UTCispytz.UTC) |
I'm assuming the intent of test_module_property() is to check that gcloud._helpers.UTC is defined and has the right sort of value. It was failing if pytz happened to be installed. Note that the current test environment does _not_ install pytz. The gcloud package uses pytz if it is available but does not depend on it. As per a suggestion from @tseaver, we test gcloud._helpers.UTC against pytz.UTC if pytz is available.
rimey
commented
Apr 8, 2016
Done. PTAL. |
tseaver
commented
Apr 8, 2016
Thanks very much! |
dhermes
commented
Apr 8, 2016
Why do we no cover both branches? |
rimey
commented
Apr 8, 2016
Only one is executed in any given test environment. Did I understand your On Fri, Apr 8, 2016 at 11:48 AM, Danny Hermes notifications@github.com
|
dhermes
commented
Apr 8, 2016
But the relevant coverage environment, i.e. the one that get's reported on our repo (from coveralls.io) use the |
rimey
commented
Apr 8, 2016
I guess the idea is that the test code will do the right thing in any On Fri, Apr 8, 2016 at 11:55 AM, Danny Hermes notifications@github.com
|
dhermes
commented
Apr 8, 2016
Thanks for sending the PR! |
Co-authored-by: Yu-Han Liu <yuhanliu@google.com>
🤖 I have created a release *beep* *boop* --- ## [1.11.9](https://togithub.com/googleapis/gapic-generator-python/compare/v1.11.8...v1.11.9) (2023-10-18) ### Bug Fixes * Rename rst files to avoid conflict with service names ([#1706](https://togithub.com/googleapis/gapic-generator-python/issues/1706)) ([70c3db5](https://togithub.com/googleapis/gapic-generator-python/commit/70c3db5ae1bac69e8ade13e4608af60c824e7870)) --- This PR was generated with [Release Please](https://togithub.com/googleapis/release-please). See [documentation](https://togithub.com/googleapis/release-please#release-please).
* chore: improve get_started notebook * some more polishing * add dots
I'm assuming the intent of test_module_property() is
to check that gcloud._helpers.UTC is defined and has
the right sort of value. It was failing if pytz
happened to be installed.
Note that the current test environment does not
install pytz. The gcloud package uses pytz if it is
available but does not depend on it.