==> Starting check()... ============================= test session starts ============================== platform linux -- Python 3.13.1, pytest-8.3.4, pluggy-1.5.0 rootdir: /home/builder/build/src/mathics3-8.0.1 configfile: pyproject.toml collected 3290 items test/autoload/test_gudermannian.py . [ 0%] test/builtin/arithmetic/test_abs.py ........................ [ 0%] test/builtin/arithmetic/test_assumptions.py ssssssssssssssss [ 1%] test/builtin/arithmetic/test_basic.py .................................. [ 2%] ..ssssssss.............................................................. [ 4%] ..........................................x........ [ 6%] test/builtin/arithmetic/test_element.py ....... [ 6%] test/builtin/arithmetic/test_lowlevel_properties.py .................... [ 6%] ........................... [ 7%] test/builtin/assignments/test_assign_binaryop.py .. [ 7%] test/builtin/assignments/test_assignment.py . [ 7%] test/builtin/atomic/test_numbers.py .................................... [ 8%] ........................................................................ [ 11%] [ 11%] test/builtin/atomic/test_strings.py ...................... [ 11%] test/builtin/atomic/test_strings2.py ... [ 11%] test/builtin/atomic/test_symbols.py ................. [ 12%] test/builtin/box/test_custom_boxexpression.py .. [ 12%] test/builtin/calculus/test_integrate.py . [ 12%] test/builtin/calculus/test_limit.py .... [ 12%] test/builtin/calculus/test_solve.py . [ 12%] test/builtin/colors/test_color_directives.py .. [ 12%] test/builtin/colors/test_colors.py ... [ 12%] test/builtin/distance/test_numeric.py . [ 12%] test/builtin/drawing/test_image.py ssssssssssssss [ 13%] test/builtin/drawing/test_plot.py ................. [ 13%] test/builtin/file_operations/test_path_operations.py ................... [ 14%] .. [ 14%] test/builtin/files_io/test_files.py .................................... [ 15%] ........................................ [ 16%] test/builtin/files_io/test_filesystem.py ............... [ 17%] test/builtin/files_io/test_importexport.py ............................. [ 17%] .......... [ 18%] test/builtin/files_io/test_read.py ..... [ 18%] test/builtin/functional/test_application.py ...... [ 18%] test/builtin/functional/test_apply_fns_to_lists.py ............... [ 19%] test/builtin/functional/test_functional_iteration.py ...... [ 19%] test/builtin/image/test_image.py ..................................... [ 20%] test/builtin/image/test_image_colors.py ........ [ 20%] test/builtin/list/test_association.py ............................... [ 21%] test/builtin/list/test_constructing.py ........ [ 21%] test/builtin/list/test_eol.py .......................................... [ 23%] .................................. [ 24%] test/builtin/list/test_list.py ................................... [ 25%] test/builtin/numbers/test_algebra.py ................................... [ 26%] .. [ 26%] test/builtin/numbers/test_calculus.py .................................. [ 27%] .................... [ 27%] test/builtin/numbers/test_constants.py ........... [ 28%] test/builtin/numbers/test_diffeqns.py ......... [ 28%] test/builtin/numbers/test_hyperbolic.py ........... [ 28%] test/builtin/numbers/test_linalg.py ................................ [ 29%] test/builtin/numbers/test_nintegrate.py ........ [ 30%] test/builtin/numbers/test_numbertheory.py ......................... [ 30%] test/builtin/numbers/test_randomnumbers.py ............... [ 31%] test/builtin/numbers/test_trig.py ............ [ 31%] test/builtin/patterns/test_rules.py . [ 31%] test/builtin/specialfns/test_bessel.py .............. [ 32%] test/builtin/specialfns/test_gamma.py ...... [ 32%] test/builtin/strings/test_operations.py ............... [ 32%] test/builtin/symbolic_history/test_stack.py . [ 32%] test/builtin/test_assignment.py ........................................ [ 34%] ..........ssssssssssssssssssssssss.................... [ 35%] test/builtin/test_attributes.py ................................ssssssss [ 36%] sssssssssssssssssssssssssssssssss............... [ 38%] test/builtin/test_binary.py ............................................ [ 39%] ....................................... [ 40%] test/builtin/test_comparison.py ........................................ [ 42%] ........................................................................ [ 44%] ........................................................................ [ 46%] ........................................................................ [ 48%] ............................................ [ 49%] test/builtin/test_compilation.py sssssssssss [ 50%] test/builtin/test_compile.py sssssssssssssssssssssssssssssssssssssssssss [ 51%] ssssssssss [ 51%] test/builtin/test_datentime.py ..........sssssss [ 52%] test/builtin/test_directories.py .......... [ 52%] test/builtin/test_evaluation.py ............. [ 53%] test/builtin/test_exp_structure.py ....... [ 53%] test/builtin/test_file_operations.py ................... [ 53%] test/builtin/test_forms.py ............................................. [ 55%] ....................................... [ 56%] test/builtin/test_intfns.py ..................................... [ 57%] test/builtin/test_makeboxes.py sssssss..sssssssssssss..s..s.ssssssssssss [ 58%] ssssssssssssssssssssssssssssssssssssss [ 60%] test/builtin/test_messages.py .................. [ 60%] test/builtin/test_number_form.py .............. [ 60%] test/builtin/test_numeric.py .............. [ 61%] test/builtin/test_options.py ..... [ 61%] test/builtin/test_patterns.py .......................................... [ 62%] . [ 62%] test/builtin/test_physchemdata.py . [ 62%] test/builtin/test_procedural.py .............................. [ 63%] test/builtin/test_quantities.py .............................. [ 64%] test/builtin/test_scoping.py ...... [ 64%] test/builtin/test_statistics.py . [ 64%] test/builtin/test_strings.py ........................................... [ 66%] .................................... [ 67%] test/builtin/test_system.py .... [ 67%] test/builtin/test_tensor.py ...... [ 67%] test/builtin/test_testing_expressions.py ............................... [ 68%] ........................ [ 69%] test/builtin/test_trace.py x [ 69%] test/builtin/vectors/test_mathops.py . [ 69%] test/builtin/vectors/test_vector_space_operations.py .... [ 69%] test/consistency-and-style/test_duplicate_builtins.py s [ 69%] test/consistency-and-style/test_summary_text.py ssssssssssssssssssssssss [ 70%] ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss [ 72%] sssssssssssssss [ 72%] test/core/convert/test_mpmath.py .. [ 72%] test/core/convert/test_sympy.py ....................... [ 73%] test/core/convert/test_to_regex.py ....... [ 73%] test/core/parser/test_box_parser.py . [ 73%] test/core/parser/test_convert.py ...xx.... [ 74%] test/core/parser/test_parser.py ...................................x.... [ 75%] .....x..................... [ 76%] test/core/parser/test_util.py ...... [ 76%] test/core/test_arithmetic.py ...... [ 76%] test/core/test_atoms.py ......... [ 76%] test/core/test_builtin.py ... [ 76%] test/core/test_definitions.py ................................. [ 77%] test/core/test_elements_properties.py . [ 77%] test/core/test_expression.py s. [ 78%] test/core/test_expression_constructor.py . [ 78%] test/core/test_flatten_head.py . [ 78%] test/core/test_is_literal.py . [ 78%] test/core/test_rules.py XXxXXXXXXXxXxXXXxXXxX....................... [ 79%] test/core/test_serialization.py . [ 79%] test/core/test_streams.py . [ 79%] test/core/test_symbols.py . [ 79%] test/core/test_sympy_python_convert.py ..................xx [ 80%] test/doc/test_common.py ... [ 80%] test/doc/test_doctests.py .. [ 80%] test/doc/test_latex.py .. [ 80%] test/eval/test_makeboxes.py ................................ [ 81%] test/eval/test_patterns.py .................... [ 81%] test/eval/test_tensors.py .... [ 82%] test/format/test_asy.py ...... [ 82%] test/format/test_format.py ............................................. [ 83%] ........................................................................ [ 85%] ........................................................................ [ 87%] ........................................................................ [ 90%] ..................................................................... [ 92%] test/format/test_latex.py ......... [ 92%] test/format/test_svg.py ..... [ 92%] test/package/test_vectoranalysis.py ................................. [ 93%] test/test_combinatorial.py . [ 93%] test/test_constrmatrix.py . [ 93%] test/test_context.py ........................................... [ 95%] test/test_control.py ... [ 95%] test/test_deletecases.py ........ [ 95%] test/test_evaluation.py ..............................sssss............. [ 96%] .. [ 96%] test/test_evaluators.py ............................... [ 97%] test/test_help.py .. [ 97%] test/test_inout.py . [ 97%] test/test_main.py F [ 97%] test/test_main_preeval.py . [ 98%] test/test_numericq.py ................................... [ 99%] test/test_numpy_utils.py ............... [ 99%] test/test_returncode.py F [ 99%] test/test_series.py .....x [ 99%] test/test_settings.py .. [ 99%] test/test_structure.py .... [ 99%] test/test_system_info.py . [ 99%] test/test_to_python.py . [100%] =================================== FAILURES =================================== ___________________________________ test_cli ___________________________________ @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") # asserts output contains 'Hello' and '2' > result = subprocess.run( ["mathics", "-e", "Print[1+1];", "-script", script_file], capture_output=True, ) /home/builder/build/src/mathics3-8.0.1/test/test_main.py:23: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3.13/subprocess.py:554: in run with Popen(*popenargs, **kwargs) as process: /usr/lib/python3.13/subprocess.py:1036: in __init__ self._execute_child(args, executable, preexec_fn, close_fds, _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = args = ['mathics', '-e', 'Print[1+1];', '-script', '/home/builder/build/src/mathics3-8.0.1/test/data/script.m'] executable = b'mathics', preexec_fn = None, close_fds = True, pass_fds = () cwd = None, env = None, startupinfo = None, creationflags = 0, shell = False p2cread = -1, p2cwrite = -1, c2pread = 18, c2pwrite = 19, errread = 20 errwrite = 21, restore_signals = True, gid = None, gids = None, uid = None umask = -1, start_new_session = False, process_group = -1 def _execute_child(self, args, executable, preexec_fn, close_fds, pass_fds, cwd, env, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite, restore_signals, gid, gids, uid, umask, start_new_session, process_group): """Execute program (POSIX version)""" if isinstance(args, (str, bytes)): args = [args] elif isinstance(args, os.PathLike): if shell: raise TypeError('path-like args is not allowed when ' 'shell is true') args = [args] else: args = list(args) if shell: # On Android the default shell is at '/system/bin/sh'. unix_shell = ('/system/bin/sh' if hasattr(sys, 'getandroidapilevel') else '/bin/sh') args = [unix_shell, "-c"] + args if executable: args[0] = executable if executable is None: executable = args[0] sys.audit("subprocess.Popen", executable, args, cwd, env) if (_USE_POSIX_SPAWN and os.path.dirname(executable) and preexec_fn is None and (not close_fds or _HAVE_POSIX_SPAWN_CLOSEFROM) and not pass_fds and cwd is None and (p2cread == -1 or p2cread > 2) and (c2pwrite == -1 or c2pwrite > 2) and (errwrite == -1 or errwrite > 2) and not start_new_session and process_group == -1 and gid is None and gids is None and uid is None and umask < 0): self._posix_spawn(args, executable, env, restore_signals, close_fds, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite) return orig_executable = executable # For transferring possible exec failure from child to parent. # Data format: "exception name:hex errno:description" # Pickle is not used; it is complex and involves memory allocation. errpipe_read, errpipe_write = os.pipe() # errpipe_write must not be in the standard io 0, 1, or 2 fd range. low_fds_to_close = [] while errpipe_write < 3: low_fds_to_close.append(errpipe_write) errpipe_write = os.dup(errpipe_write) for low_fd in low_fds_to_close: os.close(low_fd) try: try: # We must avoid complex work that could involve # malloc or free in the child process to avoid # potential deadlocks, thus we do all this here. # and pass it to fork_exec() if env is not None: env_list = [] for k, v in env.items(): k = os.fsencode(k) if b'=' in k: raise ValueError("illegal environment variable name") env_list.append(k + b'=' + os.fsencode(v)) else: env_list = None # Use execv instead of execve. executable = os.fsencode(executable) if os.path.dirname(executable): executable_list = (executable,) else: # This matches the behavior of os._execvpe(). executable_list = tuple( os.path.join(os.fsencode(dir), executable) for dir in os.get_exec_path(env)) fds_to_keep = set(pass_fds) fds_to_keep.add(errpipe_write) self.pid = _fork_exec( args, executable_list, close_fds, tuple(sorted(map(int, fds_to_keep))), cwd, env_list, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite, errpipe_read, errpipe_write, restore_signals, start_new_session, process_group, gid, gids, uid, umask, preexec_fn, _USE_VFORK) self._child_created = True finally: # be sure the FD is closed no matter what os.close(errpipe_write) self._close_pipe_fds(p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite) # Wait for exec to fail or succeed; possibly raising an # exception (limited in size) errpipe_data = bytearray() while True: part = os.read(errpipe_read, 50000) errpipe_data += part if not part or len(errpipe_data) > 50000: break finally: # be sure the FD is closed no matter what os.close(errpipe_read) if errpipe_data: try: pid, sts = os.waitpid(self.pid, 0) if pid == self.pid: self._handle_exitstatus(sts) else: self.returncode = sys.maxsize except ChildProcessError: pass try: exception_name, hex_errno, err_msg = ( errpipe_data.split(b':', 2)) # The encoding here should match the encoding # written in by the subprocess implementations # like _posixsubprocess err_msg = err_msg.decode() except ValueError: exception_name = b'SubprocessError' hex_errno = b'0' err_msg = 'Bad exception data from child: {!r}'.format( bytes(errpipe_data)) child_exception_type = getattr( builtins, exception_name.decode('ascii'), SubprocessError) if issubclass(child_exception_type, OSError) and hex_errno: errno_num = int(hex_errno, 16) if err_msg == "noexec:chdir": err_msg = "" # The error must be from chdir(cwd). err_filename = cwd elif err_msg == "noexec": err_msg = "" err_filename = None else: err_filename = orig_executable if errno_num != 0: err_msg = os.strerror(errno_num) if err_filename is not None: > raise child_exception_type(errno_num, err_msg, err_filename) E FileNotFoundError: [Errno 2] No such file or directory: 'mathics' /usr/lib/python3.13/subprocess.py:1966: FileNotFoundError _______________________________ test_returncode ________________________________ @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 /home/builder/build/src/mathics3-8.0.1/test/test_returncode.py:19: _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ /usr/lib/python3.13/subprocess.py:554: in run with Popen(*popenargs, **kwargs) as process: /usr/lib/python3.13/subprocess.py:1036: in __init__ self._execute_child(args, executable, preexec_fn, close_fds, _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ self = args = ['mathics', '-e', 'Quit[5]'], executable = b'mathics', preexec_fn = None close_fds = True, pass_fds = (), cwd = None, env = None, startupinfo = None creationflags = 0, shell = False, p2cread = -1, p2cwrite = -1, c2pread = -1 c2pwrite = -1, errread = -1, errwrite = -1, restore_signals = True, gid = None gids = None, uid = None, umask = -1, start_new_session = False process_group = -1 def _execute_child(self, args, executable, preexec_fn, close_fds, pass_fds, cwd, env, startupinfo, creationflags, shell, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite, restore_signals, gid, gids, uid, umask, start_new_session, process_group): """Execute program (POSIX version)""" if isinstance(args, (str, bytes)): args = [args] elif isinstance(args, os.PathLike): if shell: raise TypeError('path-like args is not allowed when ' 'shell is true') args = [args] else: args = list(args) if shell: # On Android the default shell is at '/system/bin/sh'. unix_shell = ('/system/bin/sh' if hasattr(sys, 'getandroidapilevel') else '/bin/sh') args = [unix_shell, "-c"] + args if executable: args[0] = executable if executable is None: executable = args[0] sys.audit("subprocess.Popen", executable, args, cwd, env) if (_USE_POSIX_SPAWN and os.path.dirname(executable) and preexec_fn is None and (not close_fds or _HAVE_POSIX_SPAWN_CLOSEFROM) and not pass_fds and cwd is None and (p2cread == -1 or p2cread > 2) and (c2pwrite == -1 or c2pwrite > 2) and (errwrite == -1 or errwrite > 2) and not start_new_session and process_group == -1 and gid is None and gids is None and uid is None and umask < 0): self._posix_spawn(args, executable, env, restore_signals, close_fds, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite) return orig_executable = executable # For transferring possible exec failure from child to parent. # Data format: "exception name:hex errno:description" # Pickle is not used; it is complex and involves memory allocation. errpipe_read, errpipe_write = os.pipe() # errpipe_write must not be in the standard io 0, 1, or 2 fd range. low_fds_to_close = [] while errpipe_write < 3: low_fds_to_close.append(errpipe_write) errpipe_write = os.dup(errpipe_write) for low_fd in low_fds_to_close: os.close(low_fd) try: try: # We must avoid complex work that could involve # malloc or free in the child process to avoid # potential deadlocks, thus we do all this here. # and pass it to fork_exec() if env is not None: env_list = [] for k, v in env.items(): k = os.fsencode(k) if b'=' in k: raise ValueError("illegal environment variable name") env_list.append(k + b'=' + os.fsencode(v)) else: env_list = None # Use execv instead of execve. executable = os.fsencode(executable) if os.path.dirname(executable): executable_list = (executable,) else: # This matches the behavior of os._execvpe(). executable_list = tuple( os.path.join(os.fsencode(dir), executable) for dir in os.get_exec_path(env)) fds_to_keep = set(pass_fds) fds_to_keep.add(errpipe_write) self.pid = _fork_exec( args, executable_list, close_fds, tuple(sorted(map(int, fds_to_keep))), cwd, env_list, p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite, errpipe_read, errpipe_write, restore_signals, start_new_session, process_group, gid, gids, uid, umask, preexec_fn, _USE_VFORK) self._child_created = True finally: # be sure the FD is closed no matter what os.close(errpipe_write) self._close_pipe_fds(p2cread, p2cwrite, c2pread, c2pwrite, errread, errwrite) # Wait for exec to fail or succeed; possibly raising an # exception (limited in size) errpipe_data = bytearray() while True: part = os.read(errpipe_read, 50000) errpipe_data += part if not part or len(errpipe_data) > 50000: break finally: # be sure the FD is closed no matter what os.close(errpipe_read) if errpipe_data: try: pid, sts = os.waitpid(self.pid, 0) if pid == self.pid: self._handle_exitstatus(sts) else: self.returncode = sys.maxsize except ChildProcessError: pass try: exception_name, hex_errno, err_msg = ( errpipe_data.split(b':', 2)) # The encoding here should match the encoding # written in by the subprocess implementations # like _posixsubprocess err_msg = err_msg.decode() except ValueError: exception_name = b'SubprocessError' hex_errno = b'0' err_msg = 'Bad exception data from child: {!r}'.format( bytes(errpipe_data)) child_exception_type = getattr( builtins, exception_name.decode('ascii'), SubprocessError) if issubclass(child_exception_type, OSError) and hex_errno: errno_num = int(hex_errno, 16) if err_msg == "noexec:chdir": err_msg = "" # The error must be from chdir(cwd). err_filename = cwd elif err_msg == "noexec": err_msg = "" err_filename = None else: err_filename = orig_executable if errno_num != 0: err_msg = os.strerror(errno_num) if err_filename is not None: > raise child_exception_type(errno_num, err_msg, err_filename) E FileNotFoundError: [Errno 2] No such file or directory: 'mathics' /usr/lib/python3.13/subprocess.py:1966: FileNotFoundError =============================== warnings summary =============================== ../../../../../usr/lib/python3.13/site-packages/stopit/__init__.py:10 /usr/lib/python3.13/site-packages/stopit/__init__.py:10: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html import pkg_resources test/core/test_atoms.py:48 /home/builder/build/src/mathics3-8.0.1/test/core/test_atoms.py:48: PytestAssertRewriteWarning: assertion is always true, perhaps remove parentheses? assert ( test/core/test_atoms.py:53 /home/builder/build/src/mathics3-8.0.1/test/core/test_atoms.py:53: PytestAssertRewriteWarning: assertion is always true, perhaps remove parentheses? assert ( test/builtin/test_datentime.py::test_datelist test/builtin/test_datentime.py::test_datelist test/builtin/test_datentime.py::test_datelist /home/builder/build/src/mathics3-8.0.1/mathics/builtin/datentime.py:318: DeprecationWarning: Parsing dates involving a day of month without a year specified is ambiguious and fails to parse leap day. The default behavior will change in Python 3.15 to either always raise an exception or to use a different default year (TBD). To avoid trouble, add a specific year to the input & format. See https://github.com/python/cpython/issues/70647. date.date = datetime.strptime(str(etime[0]).strip('"'), form) -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html =========================== short test summary info ============================ FAILED test/test_main.py::test_cli - FileNotFoundError: [Errno 2] No such file or directory: 'mathics' FAILED test/test_returncode.py::test_returncode - FileNotFoundError: [Errno 2] No such file or directory: 'mathics' = 2 failed, 2894 passed, 364 skipped, 14 xfailed, 16 xpassed, 6 warnings in 83.09s (0:01:23) = ==> ERROR: A failure occurred in check().