Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.github: Add CI for pypy series #159

Merged
merged 4 commits into from Apr 21, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions .github/workflows/build.yml
Expand Up @@ -22,6 +22,12 @@ jobs:
python: '3.9'
- os: ubuntu-latest
python: '3.10'
- os: ubuntu-latest
python: 'pypy-3.9'
- os: ubuntu-latest
python: 'pypy-3.8'
- os: ubuntu-latest
python: 'pypy-3.7'
corona10 marked this conversation as resolved.
Show resolved Hide resolved

steps:
- uses: actions/checkout@v3
Expand Down
18 changes: 10 additions & 8 deletions pyperf/tests/test_timeit.py
Expand Up @@ -392,22 +392,24 @@ def test_raises_if_setup_and_stmt_contain_invalid_syntax(self):
Timer(setup="foo = 'bar', \\ ", stmt="bar = 'baz'")

err = cm.exception
found = False
for msg in ["Unknown character", "unexpected character after line"]:
if msg in str(err):
found = True

if PYPY:
self.assertTrue("Unknown character" in str(err))
else:
self.assertTrue('unexpected character after line' in str(err))
self.assertTrue(found)

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

err = cm.exception
found = False
for msg in ["Unknown character", "unexpected character after line"]:
if msg in str(err):
found = True

if PYPY:
self.assertTrue("Unknown character" in str(err))
else:
self.assertTrue('unexpected character after line' in str(err))
self.assertTrue(found)

def test_returns_valid_template_if_setup_is_str(self):
setup = "foo = 'bar'\nbar = 'baz'"
Expand Down