Skip to content

Commit a3737e6

Browse files
committed
Drop 'pragma: NO COVER' for '__repr__' methods.
Suppress coverage for them instead via .coveragerc.
1 parent 13b0550 commit a3737e6

7 files changed

Lines changed: 13 additions & 8 deletions

File tree

.coveragerc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,8 @@
22
omit =
33
*/demo/*
44
*/demo.py
5+
exclude_lines =
6+
# Re-enable the standard pragma
7+
pragma: NO COVER
8+
# Ignore debug-only repr
9+
def __repr__

gcloud/datastore/entity.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ def delete(self):
230230
dataset_id=self.dataset().id(), key_pb=self.key().to_protobuf())
231231
# pylint: enable=maybe-no-member
232232

233-
def __repr__(self): # pragma NO COVER
233+
def __repr__(self):
234234
# An entity should have a key all the time (even if it's partial).
235235
if self.key():
236236
# pylint: disable=maybe-no-member

gcloud/datastore/key.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,5 +286,5 @@ def parent(self):
286286
return None
287287
return self.path(self.path()[:-1])
288288

289-
def __repr__(self): # pragma NO COVER
289+
def __repr__(self):
290290
return '<Key%s>' % self.path()

gcloud/storage/acl.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ def __str__(self):
110110
else:
111111
return '{self.type}-{self.identifier}'.format(self=self)
112112

113-
def __repr__(self): # pragma NO COVER
113+
def __repr__(self):
114114
return '<ACL Entity: {self} ({roles})>'.format(
115115
self=self, roles=', '.join(self.roles))
116116

gcloud/storage/bucket.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def from_dict(cls, bucket_dict, connection=None):
4242
return cls(connection=connection, name=bucket_dict['name'],
4343
metadata=bucket_dict)
4444

45-
def __repr__(self): # pragma NO COVER
45+
def __repr__(self):
4646
return '<Bucket: %s>' % self.name
4747

4848
def __iter__(self):
@@ -126,7 +126,7 @@ def new_key(self, key):
126126
# Support Python 2 and 3.
127127
try:
128128
string_type = basestring
129-
except NameError: # pragma NO COVER PY3k
129+
except NameError: # pragma: NO COVER PY3k
130130
string_type = str
131131

132132
if isinstance(key, string_type):

gcloud/storage/connection.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def _utcnow():
2626
"""
2727
if _UTCNOW is not None:
2828
return _UTCNOW
29-
return datetime.datetime.utcnow() # pragma NO COVER
29+
return datetime.datetime.utcnow() # pragma: NO COVER
3030

3131

3232
class Connection(connection.Connection):
@@ -430,7 +430,7 @@ def new_bucket(self, bucket):
430430
# Support Python 2 and 3.
431431
try:
432432
string_type = basestring
433-
except NameError: # pragma NO COVER PY3k
433+
except NameError: # pragma: NO COVER PY3k
434434
string_type = str
435435

436436
if isinstance(bucket, string_type):

gcloud/storage/key.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ def from_dict(cls, key_dict, bucket=None):
5858

5959
return cls(bucket=bucket, name=key_dict['name'], metadata=key_dict)
6060

61-
def __repr__(self): # pragma NO COVER
61+
def __repr__(self):
6262
if self.bucket:
6363
bucket_name = self.bucket.name
6464
else:

0 commit comments

Comments
 (0)