コード例 #1
0
ファイル: helpers.py プロジェクト: Alex-Ian-Hamilton/sunpy
 def wrapper(*args, **kwargs):
     plt.figure()
     name = "{0}.{1}".format(test_function.__module__, test_function.__name__)
     figure_hash = hash.hash_figure(test_function(*args, **kwargs))
     if name not in hash.hash_library:
         hash.hash_library[name] = figure_hash
         pytest.fail("Hash not present: {0}".format(name))
     else:
         assert hash.hash_library[name] == figure_hash
コード例 #2
0
ファイル: helpers.py プロジェクト: tyagi-prashant/sunpy
 def wrapper(*args, **kwargs):
     plt.figure()
     name = "{0}.{1}".format(test_function.__module__,
                             test_function.__name__)
     figure_hash = hash.hash_figure(test_function(*args, **kwargs))
     if name not in hash.hash_library:
         hash.hash_library[name] = figure_hash
         pytest.fail("Hash not present: {0}".format(name))
     else:
         assert hash.hash_library[name] == figure_hash
コード例 #3
0
ファイル: helpers.py プロジェクト: mirca/sunpy
 def wrapper(*args, **kwargs):
     plt.figure()
     name = "{0}.{1}".format(test_function.__module__, test_function.__name__)
     pngfile = tempfile.NamedTemporaryFile(delete=False)
     figure_hash = hash.hash_figure(test_function(*args, **kwargs), out_stream=pngfile)
     figure_test_pngfiles[name] = pngfile.name
     pngfile.close()
     new_hash_library[name] = figure_hash
     if name not in hash.hash_library:
         pytest.fail("Hash not present: {0}".format(name))
     else:
         assert hash.hash_library[name] == figure_hash
     plt.close()
コード例 #4
0
ファイル: helpers.py プロジェクト: saurvs/sunpy
 def wrapper(*args, **kwargs):
     plt.figure()
     name = "{0}.{1}".format(test_function.__module__,
                             test_function.__name__)
     pngfile = tempfile.NamedTemporaryFile(delete=False)
     figure_hash = hash.hash_figure(test_function(*args, **kwargs),
                                    out_stream=pngfile)
     figure_test_pngfiles[name] = pngfile.name
     pngfile.close()
     new_hash_library[name] = figure_hash
     if name not in hash.hash_library:
         pytest.fail("Hash not present: {0}".format(name))
     else:
         assert hash.hash_library[name] == figure_hash
コード例 #5
0
 def wrapper(*args, **kwargs):
     if not os.path.exists(hash.HASH_LIBRARY_FILE):
         pytest.xfail('Could not find a figure hash library at {}'.format(
             hash.HASH_LIBRARY_FILE))
     plt.figure()
     name = "{0}.{1}".format(test_function.__module__,
                             test_function.__name__)
     pngfile = tempfile.NamedTemporaryFile(delete=False)
     figure_hash = hash.hash_figure(test_function(*args, **kwargs),
                                    out_stream=pngfile)
     figure_test_pngfiles[name] = pngfile.name
     pngfile.close()
     new_hash_library[name] = figure_hash
     if name not in hash.hash_library:
         pytest.fail("Hash not present: {0}".format(name))
     else:
         assert hash.hash_library[name] == figure_hash
     plt.close()