Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# https://beta.ruff.rs
name: pytest
on:
push:
# branches: [master]
pull_request:
branches: [master]
jobs:
pytest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: pip install --user pytest
- run: pytest
14 changes: 9 additions & 5 deletions test/test_test262.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,13 @@

import sys
import os
import cStringIO
from functools import wraps

try:
from cStringIO import StringIO # Python 2
except ImportError:
from io import StringIO # Python 3

sys.path.append("src")

import test262
Expand Down Expand Up @@ -88,7 +92,7 @@ def test_summary_logfile(self):
progress.succeeded = 98
progress.failed = 2

fake_log = cStringIO.StringIO()
fake_log = StringIO()
test_suite.logf = fake_log

result = mute(True)(test_suite.PrintSummary)(progress, True)
Expand Down Expand Up @@ -154,7 +158,7 @@ def test_summary_withfails_andlog(self):
MockResult(MockTest("bar", True))
]

fake_log = cStringIO.StringIO()
fake_log = StringIO()
test_suite.logf = fake_log

expected_out = """
Expand Down Expand Up @@ -195,7 +199,7 @@ def test_summary_success_logfile(self):
progress.succeeded = 100
progress.failed = 0

fake_log = cStringIO.StringIO()
fake_log = StringIO()
test_suite.logf = fake_log

result = mute(True)(test_suite.PrintSummary)(progress, True)
Expand Down Expand Up @@ -253,7 +257,7 @@ def decorator(func):
def wrapper(*args, **kwargs):

saved_stdout = sys.stdout
sys.stdout = cStringIO.StringIO()
sys.stdout = StringIO()

try:
out = func(*args, **kwargs)
Expand Down