Skip to content

Commit 1edbf2b

Browse files
corona10hugovk
andauthored
.github: Add CI for pypy series (#159)
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
1 parent 989d38f commit 1edbf2b

File tree

2 files changed

+16
-8
lines changed

2 files changed

+16
-8
lines changed

.github/workflows/build.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ jobs:
1414
os: [ubuntu-latest, macos-latest, windows-latest]
1515
python: ['3.11']
1616
include:
17+
- os: ubuntu-latest
18+
python: 'pypy3.9'
19+
- os: ubuntu-latest
20+
python: 'pypy3.8'
21+
- os: ubuntu-latest
22+
python: 'pypy3.7'
1723
- os: ubuntu-latest
1824
python: '3.7'
1925
- os: ubuntu-latest

pyperf/tests/test_timeit.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -392,22 +392,24 @@ def test_raises_if_setup_and_stmt_contain_invalid_syntax(self):
392392
Timer(setup="foo = 'bar', \\ ", stmt="bar = 'baz'")
393393

394394
err = cm.exception
395+
found = False
396+
for msg in ["Unknown character", "unexpected character after line"]:
397+
if msg in str(err):
398+
found = True
395399

396-
if PYPY:
397-
self.assertTrue("Unknown character" in str(err))
398-
else:
399-
self.assertTrue('unexpected character after line' in str(err))
400+
self.assertTrue(found)
400401

401402
def test_raises_if_stmt_and_teardown_contain_invalid_syntax(self):
402403
with self.assertRaises(SyntaxError) as cm:
403404
Timer(stmt="foo = 'bar', \\ ", teardown="bar = 'baz'")
404405

405406
err = cm.exception
407+
found = False
408+
for msg in ["Unknown character", "unexpected character after line"]:
409+
if msg in str(err):
410+
found = True
406411

407-
if PYPY:
408-
self.assertTrue("Unknown character" in str(err))
409-
else:
410-
self.assertTrue('unexpected character after line' in str(err))
412+
self.assertTrue(found)
411413

412414
def test_returns_valid_template_if_setup_is_str(self):
413415
setup = "foo = 'bar'\nbar = 'baz'"

0 commit comments

Comments
 (0)