summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul McGuire <paulmcg@infinite.io>2019-11-05 09:04:36 -0600
committerPaul McGuire <paulmcg@infinite.io>2019-11-05 09:04:36 -0600
commitfae08dcf027bb14282196cbbae1b4059e397ddea (patch)
treec6afb483a0a91e27ef6293ea32b8a0651b597df4
parentd78e9319916c9bc7853e4e16a96c8bae56272b45 (diff)
downloadpyparsing-git-fae08dcf027bb14282196cbbae1b4059e397ddea.tar.gz
Clean up DeprecationWarnings and Py2 compat warnings
-rw-r--r--.travis.yml1
-rw-r--r--unitTests.py14
2 files changed, 9 insertions, 6 deletions
diff --git a/.travis.yml b/.travis.yml
index 0d3fccf..daa56e3 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -9,6 +9,7 @@ matrix:
- python: 3.5
- python: 3.6
- python: 3.7
+ - python: 3.8
dist: xenial
sudo: true
fast_finish: true
diff --git a/unitTests.py b/unitTests.py
index da15ae3..906fcf0 100644
--- a/unitTests.py
+++ b/unitTests.py
@@ -3895,8 +3895,8 @@ class CloseMatchTest(ParseTestCase):
for r, exp in zip(results, expected):
if exp is not None:
- self.assertEquals(r[1].mismatches, exp,
- "fail CloseMatch between %r and %r" % (searchseq.match_string, r[0]))
+ self.assertEqual(r[1].mismatches, exp,
+ "fail CloseMatch between %r and %r" % (searchseq.match_string, r[0]))
print_(r[0], 'exc: %s' % r[1] if exp is None and isinstance(r[1], Exception)
else ("no match", "match")[r[1].mismatches == exp])
@@ -4434,6 +4434,7 @@ class ParseResultsWithNameMatchFirst(ParseTestCase):
with self.assertWarns(UserWarning, msg="failed to warn of And within alternation"):
expr = (expr_a | expr_b)('rexp')
else:
+ self.expect_warning = True
expr = (expr_a | expr_b)('rexp')
expr.runTests("""
not the bird
@@ -4474,6 +4475,7 @@ class ParseResultsWithNameOr(ParseTestCase):
with self.assertWarns(UserWarning, msg="failed to warn of And within alternation"):
expr = (expr_a ^ expr_b)('rexp')
else:
+ self.expect_warning = True
expr = (expr_a ^ expr_b)('rexp')
expr.runTests("""\
not the bird
@@ -4695,10 +4697,10 @@ class EnableDebugOnNamedExpressionsTest(ParseTestCase):
""")
output = test_stdout.getvalue()
print_(output)
- self.assertEquals(output,
- expected_debug_output,
- "failed to auto-enable debug on named expressions "
- "using enable_debug_on_named_expressions")
+ self.assertEqual(output,
+ expected_debug_output,
+ "failed to auto-enable debug on named expressions "
+ "using enable_debug_on_named_expressions")
class UndesirableButCommonPracticesTest(ParseTestCase):