summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
...
* Add make_diagram.py to examples to demonstrate creating railroad diags for ↵ptmcg2020-06-271-1/+2
| | | | selected examples
* Blackeningptmcg2020-06-261-6/+18
|
* Restructure unit tests to do proper testing with and without packrat enabledptmcg2020-06-261-11/+26
|
* Revert to Python 3.7.1 for most compatibility; rewrite explain() unit test ↵ptmcg2020-06-261-9/+22
| | | | to be more tolerant of variations in TypeError str formatting
* Modify expected explain string to use Python version-specific TypeErrorptmcg2020-06-251-1/+8
|
* More thorough ParseException.explain testingptmcg2020-06-251-13/+62
|
* Add unit tests for miscellaneous ParseException methods/behaviorptmcg2020-06-251-0/+48
|
* Diagram improvements IV (#225)Michael Milton2020-06-241-4/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add diagram documentation, add more diagram tests, allow more customization of diagrams * Remove accidental edit of unrelated documentation * Add diagram package * Add jinja file to manifest * Add to bdist also * package_data * Railroad improvements * Partial rewrite * Update * Use partials everywhere so we can edit the tree before it's constructed * Rewrite the diagram generator to not duplicate any content; use monospaced font for titles * Small documentation change * Revert back to Python 3.5 type hints, fix a small bug * More diagram fixes * Even more pruning; update docs to use SQL example * Don't check the string value of names now that we don't have to
* Follow-up to default vs custom name tracking, from Issue #223ptmcg2020-06-241-18/+18
|
* warn_on_assignment_to_Forward not working on PyPy - disable test for now if ↵ptmcg2020-06-101-4/+5
| | | | running on PyPy
* warn_on_assignment_to_Forward not working on PyPy - disable test for now if ↵ptmcg2020-06-101-1/+6
| | | | running on PyPy
* Add new warnings about common errors using Forward: ↵ptmcg2020-06-091-15/+62
| | | | warn_on_parse_using_empty_Forward warns when failing to attach an expression; warn_on_assignment_to_Forward warns when using '=' instead of '<<='
* Additional configuration for `skipWhitespace` and `leaveWhitespace` (#219)Michael Milton2020-06-091-0/+91
| | | | | | | * Add .ignoreWhitespace() method * Add recursive arg to leave- and ignoreWhitespace(), with tests * Add tests and implementation of the recursive flag
* Railroad Diagram Improvements (#220)Michael Milton2020-06-031-0/+18
| | | | | | * Add diagram documentation, add more diagram tests, allow more customization of diagrams * Remove accidental edit of unrelated documentation
* Railroad Diagrams (#218)Michael Milton2020-05-311-0/+38
| | | | | | | | | | | | | * Basic framework * Initial effort * Clean up and document code * jinja newline * Pre-commit, and add extras to tox * We can't use the class type-annotations syntax in Python 3.5
* Add GoToColumn test (#217)Matt Carmody2020-05-311-0/+38
| | | | | * Add GoToColumn test * Update GoToColumn test with ptmcg's feedback
* Add misc unit tests for core elements with missing coverage (#214)Matt Carmody2020-05-181-0/+121
| | | | | | | | | | | | | | | | | * Expand testQuotedStrings * Add tests for expr[n] edge cases * Add ParserElement.ignore(str) test * Add Regex invalid type test * Add test for Word with min=0 * Add Char with asKeyword=True test * Add CharsNotIn tests * Remove unused __req__ and __rne__
* Imports cleanup in unit tests (#215)Matt Carmody2020-05-171-224/+119
| | | | | * Remove unused import & variables in tests * Remove exploded pyparsing imports
* Added unit test for modified countedArray metadata (#209)ptmcg2020-05-131-0/+61
|
* Parser Element and Keyword tests (#199)Matt Carmody2020-05-121-4/+263
| | | | | | | | | | | | | | | | | * Expand Keyword unit test * Add ParserElement add unit tests * Add ParserElement sub unit tests * Add ParserElement mul unit tests * Add ParserElement Match First unit tests * Add ParserElement Match Longest unit tests * Add ParserElement Each unit tests * Refactor and cleanup
* Pop counter token and return rest instead of dropping all tokens in ↵Marcin Jaworski2020-05-032-7/+7
| | | | | | | | | | | | | countedArray (#209) * Pop counter token and return rest instead of dropping all tokens * Include only named results from intExpr in countedArray results * Remove internal Group from countedArray * Fix operator precedence * Update countedArray tests
* Fixed bug in ParseResults repr() which showed all matching entries for a ↵ptmcg2020-04-101-0/+27
| | | | results name, even if listAllMatches was set to False (Issue #205)
* Enhanced error messages and error locations when parsing fails on the ↵ptmcg2020-04-031-1/+62
| | | | Keyword or CaselessKeyword classes due to the presence of a preceding or trailing keyword character. See issue #201.
* Refactor ParseException explain() static method into a staticmethod and an ↵Paul McGuire2020-03-311-7/+7
| | | | instance method on ParseBaseException
* Add OnlyOnce docstring, error message and unit test (#193)Matt Carmody2020-03-311-0/+31
|
* Add ParseResults unit tests (#198)Matt Carmody2020-03-311-0/+182
| | | | | | | | | | | | | | | | | | | | | | | | | * Add ParseResults.__new__() unit tests * Add reversed(ParseResults) unit test * Add ParseResults.values() unit test * Add ParseResults.append() unit test * Add ParseResults.clear() unit test * Add ParseResults.extend() unit tests * Add ParseResults.from_dict() unit test * Add dir(ParseResults) unit test * Add ParseResults.insert() unit test * Minor clean up * Fix dependency on dict order-preservation * Changes to incorporate notes
* Blacken unit test changesptmcg2020-03-221-13/+26
|
* Fixup matchPreviousExpr testsptmcg2020-03-221-67/+31
|
* New unit tests (#192)Matt Carmody2020-03-221-0/+196
| | | | | | | | | | | | | | | | | | | * Add tests for matchPreviousLiteral - question in comments * Bug fix - matchPreviousLiteral One line fix for scanString of matchPreviousLiteral with mulitple return tokens. Test still needs to be refactored. * Demo 3 issues in matchPreviousLiteral and matchPreviousExpr * Correct mistakes and demonstrate potential matchPreviousExpr issue * Add nestedExpr unit tests * Add makeXMLTags unit test * Add unit tests for oneOf with empty list and int input
* Housekeeping (#191)Matt Carmody2020-03-211-98/+40
| | | | | | | | | * Correct docstring typo in helpers.py * Remove repetitive imports of pyparsing in tests * Move repetitive pyparsing_common calls to module level ppc * Correct docstrings inline code typos
* Blacken changesptmcg2020-02-231-2/+7
|
* Fix bug in Each when using Regex, Regex would get parsed twice (issue #183)ptmcg2020-02-231-13/+44
|
* Test code cleanup; remove VERBOSE global and activate all related print() ↵Paul McGuire2020-02-231-75/+86
| | | | statements; remove dead ParseTest class; cleanup testSkipToParserTests test using assertRaisesParseException; fix parsers in pickle compatibility tests, and remove PickleTest_Greeting class as ParseResults wrapper; change test classes created using type() with more explicit class definitions
* Add Black formatting Git hook (#180)Kyle Lahnakoski2020-02-232-0/+11
| | | | | | | | | | | | | | | | | | * add black git hook * test change * test instructions, fix instructions * spelling * make tox and pre-commit agree on line length * start guessing what the line length parameter really is * 80 char line length * 88?
* Add unit tests to expand test coverage (#184)Matt Carmody2020-02-231-1/+114
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add unit test for pop with invalid named arg * Add unit test for setParseAction() with uncallable arg * Add unit test for __mul__ with negative number * Add unit test for __mul__ with Ellipsis * Add unit tests for matchOnlyAtCol * Add unit tests for convertToDate and converToDatetime * blacken the new tests * Add unit test for assertParseAndCheckDict * Update with feedback from ptmcg Removed unnecessary imports Replaced exception prints with ptmcg's assertRaises override * blacken updates * Update tests with additional feedback Change assertRaises(ParseException) to assertRaisesParseException() Return exception in overrided assertRaises
* Add unit test sequences for small and unbounded packrat cachesptmcg2020-02-041-0/+33
|
* Update unit tests to use pyparsing_test assert methodsPaul McGuire2020-01-271-111/+77
|
* Some unittest.TestCase cleanups (#175); black reformat of core.pyptmcg2020-01-261-266/+245
|
* Added new warning 'warn_on_match_first_with_lshift_operator' to warn when ↵ptmcg2020-01-261-4/+34
| | | | doing `fwd << a | b`; fixed potential FutureWarning when including unescaped '[' in a regex range definition.
* Break up testMiscellaneousParserTests unit test into separate test methodsptmcg2020-01-041-252/+237
|
* Rollforward infixNotation ternary op fix from 2.4.6 branch, plus related ↵ptmcg2020-01-042-3/+17
| | | | unit test; change TestParseResultsAsserts to mixin instead of subclass; rollforward 2.4.6 CHANGES blurb from 2.4.6 branch
* Include 2.4.x change notes to CHANGES; add select_parser to unit tests; ↵ptmcg2019-11-181-0/+3
| | | | minor changes to select_parser
* Use assertRaises for tests that raise exceptions (#160)Jon Dufresne2019-11-021-41/+10
|
* Use classmethod decorator (#159)Jon Dufresne2019-11-021-12/+4
| | | | | Available since Python 2.4. https://docs.python.org/3/library/functions.html#classmethod
* Use staticmethod decorator (#158)Jon Dufresne2019-11-021-21/+8
| | | | | Available since Python 2.4. https://docs.python.org/3/library/functions.html#staticmethod
* Blacken the project (#141)Jon Dufresne2019-10-313-1741/+3593
|
* Some code header cleanup; remove BUFFER_OUTPUT from test_unit.py, and ↵Paul McGuire2019-10-243-34/+19
| | | | replace most resetting() context managers and try-finallys with ppt.reset_pyparsing_context
* Use pyupgrade to upgrade the code to use Python3 conventions (#138)Jon Dufresne2019-10-242-67/+65
| | | | | | | | | | | | The pyupgrade project is available at https://github.com/asottile/pyupgrade and can be installed through pip. The pyupgrade tool automatically upgrades syntax for newer versions of the language. As pyparsing is now Python 3 only, can apply some cleanups and simplifications. Ran the tool using the following command: $ find . -name \*.py -exec pyupgrade --py3-plus {} \; For now, pyparsing.py was skipped while it is refactored to a package.
* refactor tests into tests directory (#130)Kyle Lahnakoski2019-10-218-0/+5899