diff options
| author | Todd Leonhardt <todd.leonhardt@gmail.com> | 2017-08-23 04:56:22 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-08-23 04:56:22 -0700 |
| commit | 164ed174cff272e94a6092e24c6b0d4ab18fbbe4 (patch) | |
| tree | 9c746f0799eb79e44bc4766e9ee5332ad02f293f | |
| parent | 319e66b3076e340270fbb74eb01936f88b5c268c (diff) | |
| parent | 6676d235f7413e32dbd1aab9165ee33a5c1cf737 (diff) | |
| download | cmd2-git-164ed174cff272e94a6092e24c6b0d4ab18fbbe4.tar.gz | |
Merge pull request #217 from python-cmd2/update_changelog
Updated CHANGELOG text regarding recent enhancements to transcript regexes
| -rw-r--r-- | CHANGELOG.md | 4 | ||||
| -rwxr-xr-x | cmd2.py | 10 | ||||
| -rw-r--r-- | docs/conf.py | 2 | ||||
| -rwxr-xr-x | setup.py | 2 | ||||
| -rw-r--r-- | tests/test_cmd2.py | 2 |
5 files changed, 12 insertions, 8 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 02ae8f45..efd183de 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ * For ``edit`` command, both **editor** and **filename** can now have spaces in the name/path * Enhancements * ``feedback_to_output`` now defaults to ``False`` so info like command timing won't redirect + * Transcript regular expressions now have predictable, tested, and documented behavior + * This makes a breaking change to the format and expectations of transcript testing + * The prior behavior removed whitespace before making the comparison, now whitespace must match exactly + * Prior version did not allow regexes with whitespace, new version allows any regex ## 0.7.6 (August 11, 2017) @@ -98,7 +98,7 @@ if six.PY3: else: BROKEN_PIPE_ERROR = IOError -__version__ = '0.7.7a' +__version__ = '0.7.7' # Pyparsing enablePackrat() can greatly speed up parsing, but problems have been seen in Python 3 in the past pyparsing.ParserElement.enablePackrat() @@ -2305,7 +2305,7 @@ class Cmd2TestCase(unittest.TestCase): break line_num += 1 expected = ''.join(expected) - + # transform the expected text into a valid regular expression expected = self._transform_transcript_expected(expected) message = '\nFile {}, line {}\nCommand was:\n{}\nExpected:\n{}\nGot:\n{}\n'.format( @@ -2318,7 +2318,7 @@ class Cmd2TestCase(unittest.TestCase): backslash = '\\' regex = '' start = 0 - + while True: (regex, first_slash_pos, start) = self._escaped_find(regex, s, start, False) if first_slash_pos == -1: @@ -2349,12 +2349,12 @@ class Cmd2TestCase(unittest.TestCase): def _escaped_find(self, regex, s, start, in_regex): """ Find the next slash in {s} after {start} that is not preceded by a backslash. - + If we find an escaped slash, add everything up to and including it to regex, updating {start}. {start} therefore serves two purposes, tells us where to start looking for the next thing, and also tells us where in {s} we have already added things to {regex} - + {in_regex} specifies whether we are currently searching in a regex, we behave differently if we are or if we aren't. """ diff --git a/docs/conf.py b/docs/conf.py index 52ca820b..f79d5b3c 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -62,7 +62,7 @@ author = 'Catherine Devlin and Todd Leonhardt' # The short X.Y version. version = '0.7' # The full version, including alpha/beta/rc tags. -release = '0.7.7a' +release = '0.7.7' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. @@ -5,7 +5,7 @@ Setuptools setup file, used to install or test 'cmd2' """ from setuptools import setup -VERSION = '0.7.7a' +VERSION = '0.7.7' DESCRIPTION = "cmd2 - a tool for building interactive command line applications in Python" LONG_DESCRIPTION = """cmd2 is a tool for building interactive command line applications in Python. Its goal is to make it quick and easy for developers to build feature-rich and user-friendly interactive command line applications. It diff --git a/tests/test_cmd2.py b/tests/test_cmd2.py index 10631ffa..51421bcb 100644 --- a/tests/test_cmd2.py +++ b/tests/test_cmd2.py @@ -23,7 +23,7 @@ from conftest import run_cmd, normalize, BASE_HELP, HELP_HISTORY, SHORTCUTS_TXT, def test_ver(): - assert cmd2.__version__ == '0.7.7a' + assert cmd2.__version__ == '0.7.7' def test_empty_statement(base_app): |
