Skip to content

Commit

Permalink
Fix the no cover pragmas.
Browse files Browse the repository at this point in the history
  • Loading branch information
jamadden committed Jul 31, 2018
1 parent 146255e commit da42abf
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ source = persistent

[report]
exclude_lines =
# pragma: no cover
pragma: no cover
class I[A-Z]\w+\((Interface|I[A-Z].*)\):
raise NotImplementedError
raise AssertionError
10 changes: 5 additions & 5 deletions persistent/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
from persistent.cPersistence import CHANGED
from persistent.cPersistence import STICKY
from persistent.cPersistence import simple_new
except ImportError: #pragma NO COVER
except ImportError: # pragma: no cover
from persistent.persistence import Persistent
from persistent.persistence import GHOST
from persistent.persistence import UPTODATE
Expand All @@ -39,25 +39,25 @@
# is available. Note that the Python version already does this.
try:
from zope.interface import classImplements
except ImportError: #pragma NO COVER
except ImportError: # pragma: no cover
pass
else:
from persistent.interfaces import IPersistent
classImplements(Persistent, IPersistent)

try:
from persistent.cPickleCache import PickleCache
except ImportError: #pragma NO COVER
except ImportError: # pragma: no cover
from persistent.picklecache import PickleCache

try:
import persistent.TimeStamp
except ImportError: #pragma NO COVER
except ImportError: # pragma: no cover
import persistent.timestamp as TimeStamp
import sys
sys.modules['persistent.TimeStamp'
] = sys.modules['persistent.timestamp']
else: #pragma NO COVER
else: # pragma: no cover
from persistent.persistence import Persistent
from persistent.persistence import GHOST
from persistent.persistence import UPTODATE
Expand Down
4 changes: 2 additions & 2 deletions persistent/_compat.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

import sys

if sys.version_info[0] > 2: #pragma NO COVER
if sys.version_info[0] > 2: # pragma: no cover
import copyreg as copy_reg
from collections import UserDict as IterableUserDict
from collections import UserList
Expand All @@ -36,7 +36,7 @@ def _native(s):
PYTHON3 = True
PYTHON2 = False

else: #pragma NO COVER
else: # pragma: no cover
import copy_reg
from UserDict import IterableUserDict
from UserList import UserList
Expand Down
2 changes: 1 addition & 1 deletion persistent/interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from persistent.cPersistence import UPTODATE
from persistent.cPersistence import CHANGED
from persistent.cPersistence import STICKY
except ImportError: #pragma NO COVER
except ImportError: # pragma: no cover
GHOST = -1
UPTODATE = 0
CHANGED = 1
Expand Down
6 changes: 3 additions & 3 deletions persistent/timestamp.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
def _makeOctets(s):
if sys.version_info < (3,):
return bytes(s)
return bytes(s, 'ascii') #pragma NO COVERAGE
return bytes(s, 'ascii') # pragma: no cover


_ZERO = _makeOctets('\x00' * 8)
Expand Down Expand Up @@ -175,7 +175,7 @@ def __hash__(self):

x = _wraparound(x)

if x == -1: #pragma: no cover
if x == -1: # pragma: no cover
# The C version has this condition, but it's not clear
# why; it's also not immediately obvious what bytestring
# would generate this---hence the no-cover
Expand Down Expand Up @@ -212,5 +212,5 @@ def __ge__(self, other):

try:
from persistent._timestamp import TimeStamp
except ImportError: #pragma NO COVER
except ImportError: # pragma: no cover
TimeStamp = pyTimeStamp
2 changes: 1 addition & 1 deletion persistent/wref.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def __init__(self, adict=None, **kwargs):
self.update(adict)
# XXX 'kwargs' is pointless, because keys must be strings, but we
# are going to try (and fail) to wrap a WeakRef around them.
if kwargs: #pragma NO COVER
if kwargs: # pragma: no cover
self.update(kwargs)

def __getstate__(self):
Expand Down

0 comments on commit da42abf

Please sign in to comment.