#28762 closed defect (fixed)

2 doctests failed in cmdline.py related to rst2ipynb

Reported by: slabbe Owned by:
Priority: major Milestone: sage-9.0
Component: packages: optional Keywords:
Cc: tmonteil Merged in:
Authors: Sébastien Labbé Reviewers: Travis Scrimshaw
Report Upstream: N/A Work issues:
Branch: a8ec0ca (Commits, GitHub, GitLab) Commit: a8ec0ca1c519a6cc19e2d7c8112d2ff05b159b37
Dependencies: Stopgaps:

Status badges

Description

With 9.0.beta6, Release Date: 2019-11-18, the following

sage -t --optional=sage,optional,external src/sage/tests/cmdline.py

gives

sage -t src/sage/tests/cmdline.py
**********************************************************************
File "src/sage/tests/cmdline.py", line 658, in sage.tests.cmdline.test_executable
Failed example:
    print(out)                           # optional - rst2ipynb
Expected:
    {
     "nbformat_minor": ...,
     "nbformat": ...,
     "cells": [
      {
       "source": [
        "$$\n",
        "\\def\\CC{\\bf C}\n",
        "\\def\\QQ{\\bf Q}\n",
        "\\def\\RR{\\bf R}\n",
        "\\def\\ZZ{\\bf Z}\n",
        "\\def\\NN{\\bf N}\n",
        "$$"
       ],
       "cell_type": "markdown",
       "metadata": {}
      },
      {
       "execution_count": null,
       "cell_type": "code",
       "source": [
        "2^10"
       ],
       "outputs": [
        {
         "execution_count": 1,
         "output_type": "execute_result",
         "data": {
          "text/plain": [
           "1024"
          ]
         },
         "metadata": {}
        }
       ],
       "metadata": {}
      },
      {
       "execution_count": null,
       "cell_type": "code",
       "source": [
        "2 + 2"
       ],
       "outputs": [
        {
         "execution_count": 1,
         "output_type": "execute_result",
         "data": {
          "text/plain": [
           "4"
          ]
         },
         "metadata": {}
        }
       ],
       "metadata": {}
      }
     ],
     "metadata": {
      "kernelspec": {
       "display_name": "sagemath",
       "name": "sagemath"
      }
     }
    }
Got:
    {
     "cells": [
      {
       "cell_type": "markdown",
       "metadata": {},
       "source": [
        "$$\n",
        "\\def\\CC{\\bf C}\n",
        "\\def\\QQ{\\bf Q}\n",
        "\\def\\RR{\\bf R}\n",
        "\\def\\ZZ{\\bf Z}\n",
        "\\def\\NN{\\bf N}\n",
        "$$"
       ]
      },
      {
       "cell_type": "code",
       "execution_count": null,
       "metadata": {},
       "outputs": [
        {
         "data": {
          "text/plain": [
           "1024"
          ]
         },
         "execution_count": 1,
         "metadata": {},
         "output_type": "execute_result"
        }
       ],
       "source": [
        "2^10"
       ]
      },
      {
       "cell_type": "code",
       "execution_count": null,
       "metadata": {},
       "outputs": [
        {
         "data": {
          "text/plain": [
           "4"
          ]
         },
         "execution_count": 1,
         "metadata": {},
         "output_type": "execute_result"
        }
       ],
       "source": [
        "2 + 2"
       ]
      }
     ],
     "metadata": {
      "kernelspec": {
       "display_name": "sagemath",
       "name": "sagemath"
      }
     },
     "nbformat": 4,
     "nbformat_minor": 2
    }
    <BLANKLINE>
**********************************************************************
File "src/sage/tests/cmdline.py", line 739, in sage.tests.cmdline.test_executable
Failed example:
    print(open(output, 'r').read()) # optional - rst2ipynb
Expected:
    {
     "nbformat_minor": ...,
     "nbformat": ...,
     "cells": [
      {
       "source": [
        "$$\n",
        "\\def\\CC{\\bf C}\n",
        "\\def\\QQ{\\bf Q}\n",
    ...
     "metadata": {
      "kernelspec": {
       "display_name": "sagemath",
       "name": "sagemath"
      }
     }
    }
Got:
    {
     "cells": [
      {
       "cell_type": "markdown",
       "metadata": {},
       "source": [
        "$$\n",
        "\\def\\CC{\\bf C}\n",
        "\\def\\QQ{\\bf Q}\n",
        "\\def\\RR{\\bf R}\n",
        "\\def\\ZZ{\\bf Z}\n",
        "\\def\\NN{\\bf N}\n",
        "$$"
       ]
      },
      {
       "cell_type": "code",
       "execution_count": null,
       "metadata": {},
       "outputs": [
        {
         "data": {
          "text/plain": [
           "1024"
          ]
         },
         "execution_count": 1,
         "metadata": {},
         "output_type": "execute_result"
        }
       ],
       "source": [
        "2^10"
       ]
      },
      {
       "cell_type": "code",
       "execution_count": null,
       "metadata": {},
       "outputs": [
        {
         "data": {
          "text/plain": [
           "4"
          ]
         },
         "execution_count": 1,
         "metadata": {},
         "output_type": "execute_result"
        }
       ],
       "source": [
        "2 + 2"
       ]
      }
     ],
     "metadata": {
      "kernelspec": {
       "display_name": "sagemath",
       "name": "sagemath"
      }
     },
     "nbformat": 4,
     "nbformat_minor": 2
    }
**********************************************************************
1 item had failures:
   2 of 249 in sage.tests.cmdline.test_executable
    [248 tests, 2 failures, 29.00 s]
----------------------------------------------------------------------
sage -t src/sage/tests/cmdline.py  # 2 doctests failed
----------------------------------------------------------------------
Total time for all tests: 29.2 seconds
    cpu time: 0.3 seconds
    cumulative wall time: 29.0 seconds
External software detected for doctesting: internet,pandoc

Change History (5)

comment:1 Changed 23 months ago by slabbe

  • Authors set to Sébastien Labbé
  • Branch set to u/slabbe/28762
  • Commit set to a8ec0ca1c519a6cc19e2d7c8112d2ff05b159b37
  • Status changed from new to needs_review

New commits:

a8ec0ca28762: py3: fixing doctests for rst2ipynb

comment:2 Changed 22 months ago by slabbe

  • Cc tmonteil added

comment:3 Changed 22 months ago by tscrim

  • Reviewers set to Travis Scrimshaw
  • Status changed from needs_review to positive_review

These look like much more robust doctests.

comment:4 Changed 22 months ago by slabbe

Thanks for the review.

comment:5 Changed 22 months ago by vbraun

  • Branch changed from u/slabbe/28762 to a8ec0ca1c519a6cc19e2d7c8112d2ff05b159b37
  • Resolution set to fixed
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.