Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
COVERAGE=coverage
COVERAGE?=coverage
PREFIX=/usr/local
export PREFIX
PYTHON=python
PYTHON?=python

all: build

Expand Down
10 changes: 5 additions & 5 deletions cram/_diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,18 +59,18 @@ def glob(el, l):
"""Apply a glob match to a line annotated with '(glob)'"""
return _matchannotation('glob', _glob, el, l)

def esc(el, l):
def esc(el, line):
"""Apply an escape match to a line annotated with '(esc)'"""
ann = b(' (esc)\n')

if el.endswith(ann):
el = codecs.escape_decode(el[:-len(ann)])[0] + b('\n')
if el == l:
if el == line:
return True

if l.endswith(ann):
l = codecs.escape_decode(l[:-len(ann)])[0] + b('\n')
return el == l
if line.endswith(ann):
line = codecs.escape_decode(line[:-len(ann)])[0] + b('\n')
return el == line

class _SequenceMatcher(difflib.SequenceMatcher, object):
"""Like difflib.SequenceMatcher, but supports custom match functions"""
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[bdist_wheel]
universal = true

[pep8]
[pycodestyle]
# E129: indentation between lines in conditions
# E261: two spaces before inline comment
# E301: expected blank line
Expand Down
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ def long_description():
"""Get the long description from the README"""
return open(os.path.join(sys.path[0], 'README.rst')).read()


setup(
author='Brodie Rao',
author_email='brodie@bitheap.org',
Expand Down
4 changes: 2 additions & 2 deletions tests/config.t
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Invalid option in .cramrc:
$ cram
[Uu]sage: cram \[OPTIONS\] TESTS\.\.\. (re)

cram: error: option --indent: invalid integer value: 'hmm'
cram: error: option --indent: invalid integer value: u'hmm'
[2]
$ rm .cramrc
$ cat > .cramrc <<EOF
Expand All @@ -38,7 +38,7 @@ Invalid option in .cramrc:
$ cram
[Uu]sage: cram \[OPTIONS\] TESTS\.\.\. (re)

cram: error: --verbose: invalid boolean value: 'hmm'
cram: error: --verbose: invalid boolean value: u'hmm'
[2]
$ rm .cramrc

Expand Down
1 change: 1 addition & 0 deletions tests/run-doctests.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ def rundoctests(pkgdir):
totaltests += tests
return totalfailures != 0


if __name__ == '__main__':
try:
sys.exit(rundoctests(sys.argv[1]))
Expand Down