Skip to content

Commit

Permalink
gh-38294: Filter out R warnings
Browse files Browse the repository at this point in the history
    
These are causing some doctest failures after
#35396

```
**********************************************************************
File "/usr/lib/python3.12/site-packages/sage/interfaces/r.py", line 51,
in sage.interfaces.r
Failed example:
    v = 2*x+y+1; v
Expected:
    [1] 32.2 17.8 10.3 20.2 66.1 21.8 22.6 12.8 16.9 50.8 43.5
Got:
    R[write to console]: Además:
    R[write to console]: Aviso:
    <BLANKLINE>
    R[write to console]: In sage10 + sage6 :
    R[write to console]:
    <BLANKLINE>
    R[write to console]:  longitud de objeto mayor no es múltiplo de la
longitud de uno menor
    <BLANKLINE>
     [1] 32.2 17.8 10.3 20.2 66.1 21.8 22.6 12.8 16.9 50.8 43.5
**********************************************************************
File "/usr/lib/python3.12/site-packages/sage/interfaces/r.py", line 78,
in sage.interfaces.r
Failed example:
    r(-17).sqrt()
Expected:
    [1] NaN
Got:
    R[write to console]: Además:
    R[write to console]: Aviso:
    <BLANKLINE>
    R[write to console]: In sqrt(sage10) :
    R[write to console]:  Se han producido NaNs
    <BLANKLINE>
    [1] NaN
**********************************************************************
File "/usr/lib/python3.12/site-packages/sage/interfaces/r.py", line 356,
in sage.interfaces.r._setup_r_to_sage_converter
Failed example:
    r(-17).sqrt().sage()
Expected:
    nan
Got:
    R[write to console]: Además:
    R[write to console]: Aviso:
    <BLANKLINE>
    R[write to console]: In sqrt(sage4) :
    R[write to console]:  Se han producido NaNs
    <BLANKLINE>
    nan
**********************************************************************
```
    
URL: #38294
Reported by: Antonio Rojas
Reviewer(s): Matthias Köppe
  • Loading branch information
Release Manager committed Jul 15, 2024
2 parents 2e5cb46 + 23497d0 commit 89d1d65
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/sage/doctest/parsing.py
Original file line number Diff line number Diff line change
Expand Up @@ -1688,6 +1688,12 @@ def do_fixup(self, want, got):
got = ld_pie_warning_regex.sub('', got)
did_fixup = True

if "R[write to console]" in got:
# Supress R warnings
r_warning_regex = re.compile(r'R\[write to console\]:.*')
got = r_warning_regex.sub('', got)
did_fixup = True

if "Overriding pythran description" in got:
# Some signatures changed in numpy-1.25.x that may yet be
# reverted, but which pythran would otherwise warn about.
Expand Down

0 comments on commit 89d1d65

Please sign in to comment.