test: make GC check resilient to broken weakrefs (#1099)
test: make GC check resilient to broken weakrefs (#1099)

* fix: Make gc check resilient to broken weakrefs

In some python deployments (I believe macOS is one), weakref objects aren't guaranteed to exist across gc collections. The proposed check pattern is also used in tensorflow [0] which ran into similar issues a few years ago.

[0]: https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/framework/errors_test.py#L33

* fix: add pragma for coverage

* Fix whitespace
googleapis/python-bigquery,googleapis/python-bigquery