From b9f0987348ef326e051fb8ddaa05ea98af03c729 Mon Sep 17 00:00:00 2001 From: sadrasabouri Date: Tue, 2 Nov 2021 23:51:37 +0330 Subject: [PATCH] test : tests added. --- test/warning_test.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/warning_test.py b/test/warning_test.py index 71c6b45..29479d4 100644 --- a/test/warning_test.py +++ b/test/warning_test.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- """ >>> import os +>>> import json >>> from samila import * >>> from pytest import warns >>> with warns(RuntimeWarning, match="Neither function nor data is provided."): @@ -14,5 +15,9 @@ True >>> g_.data2 == g.data2 True +>>> with open('data.json', 'w') as fp: +... json.dump({'data1': [0], 'data2': [0], 'matplotlib_version': '0'}, fp) +>>> with warns(RuntimeWarning, match="Source matplotlib version is different from yours, plots may be different."): +... g = GenerativeImage(lambda x,y: 0, lambda x,y: 0, data=open('data.json', 'r')) >>> os.remove('data.json') """