Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 23131

Doctest: How can I identify differences between expected and actual output?

$
0
0

In the below doctest, the expected and actual output look identical. I'm pretty sure there is some white space error since when I enable NORMALIZE_WHITESPACE, the test is successful. Is there another flag that can help a user triangulate on the location of such a whitespace error?

""">>> df  # doctest:-NORMALIZE_WHITESPACE              OpenDate2021-05-17  126.82"""import pandas as pddf = pd.DataFrame({'Date': ['2021-05-17'], 'Open': [126.82]}).set_index('Date')if __name__ == "__main__":    import doctest    doctest.testmod()
Failed example:    df  # doctest:-NORMALIZE_WHITESPACEExpected:                  Open    Date    2021-05-17  126.82Got:                  Open    Date    2021-05-17  126.82

Viewing all articles
Browse latest Browse all 23131

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>