Skip to content

Commit

Permalink
Skip failing tests on pyodide
Browse files Browse the repository at this point in the history
  • Loading branch information
davidar committed Oct 24, 2024
1 parent d053833 commit 14bad2f
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
/.cache
/.gdbinit
/.python-version
/.pyodide-xbuildenv-*
/Mathics.egg-info
/Mathics3.egg-info
ChangeLog
Expand Down
4 changes: 4 additions & 0 deletions test/builtin/files_io/test_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@ def test_close():
), f"temporary filename {temp_filename} should not appear"


@pytest.mark.skipif(
sys.platform in ("emscripten",),
reason="Pyodide has restricted filesystem access",
)
@pytest.mark.parametrize(
("str_expr", "msgs", "str_expected", "fail_msg"),
[
Expand Down
2 changes: 1 addition & 1 deletion test/builtin/test_datentime.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@


@pytest.mark.skipif(
sys.platform in ("win32",) or hasattr(sys, "pyston_version_info"),
sys.platform in ("win32", "emscripten") or hasattr(sys, "pyston_version_info"),
reason="TimeConstrained needs to be rewritten",
)
def test_timeremaining():
Expand Down
7 changes: 7 additions & 0 deletions test/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,20 @@
import os.path as osp
import re
import subprocess
import sys

import pytest


def get_testdir():
filename = osp.normcase(osp.dirname(osp.abspath(__file__)))
return osp.realpath(filename)


@pytest.mark.skipif(
sys.platform in ("emscripten",),
reason="Pyodide does not support processes",
)
def test_cli():
script_file = osp.join(get_testdir(), "data", "script.m")

Expand Down
7 changes: 7 additions & 0 deletions test/test_returncode.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,20 @@
# -*- coding: utf-8 -*-
import os.path as osp
import subprocess
import sys

import pytest


def get_testdir():
filename = osp.normcase(osp.dirname(osp.abspath(__file__)))
return osp.realpath(filename)


@pytest.mark.skipif(
sys.platform in ("emscripten",),
reason="Pyodide does not support processes",
)
def test_returncode():
assert subprocess.run(["mathics", "-e", "Quit[5]"]).returncode == 5
assert subprocess.run(["mathics", "-e", "1 + 2'"]).returncode == 0
Expand Down

0 comments on commit 14bad2f

Please sign in to comment.