pytest-doctestplus icon indicating copy to clipboard operation
pytest-doctestplus copied to clipboard

Add a command-line option to ignore output lines matching a specific pattern

Open astrofrog opened this issue 7 years ago • 3 comments

It would be nice to be able to specify patterns for lines to ignore - e.g. in the following case the Downloading line can be ignored:

233     >>> from astropy.coordinates import EarthLocation
234     >>> EarthLocation.of_site('Apache Point Observatory')  # doctest: +REMOTE_DATA +FLOAT_CMP
Expected:
    <EarthLocation (-1463969.30185172, -5166673.34223433,  3434985.71204565) m>
Got:
    Downloading http://data.astropy.org/coordinates/sites.json [Done]
    <EarthLocation (-1463969.30185172, -5166673.34223433,  3434985.71204565) m>

This could be added as a command-line flag to which regular expressions could be passed (maybe?)

astrofrog avatar Nov 12 '17 12:11 astrofrog

This would be such a nice feature!

bsipocz avatar Nov 13 '17 14:11 bsipocz

This would be great. I've been affected by exactly that example ("Downloading...").

larrybradley avatar Nov 13 '17 14:11 larrybradley

I remember something very similar in nbval for ignoring mpl instance hashes

bsipocz avatar May 30 '23 22:05 bsipocz