77
88from subprocess import call , Popen , PIPE
99
10- from nose import SkipTest
11- from nose . tools import assert_true
10+ import pytest
11+
1212
1313HERE = dirname (__file__ )
1414TINY_PAGES = pjoin (HERE , 'tinypages' )
@@ -19,7 +19,7 @@ def setup_module():
1919 try :
2020 ret = call (['sphinx-build' , '--help' ], stdout = PIPE , stderr = PIPE )
2121 except OSError :
22- raise SkipTest ('Need sphinx-build on path for these tests' )
22+ pytest . skip ('Need sphinx-build on path for these tests' )
2323 if ret != 0 :
2424 raise RuntimeError ('sphinx-build does not return 0' )
2525
@@ -60,29 +60,29 @@ def teardown_class(cls):
6060 shutil .rmtree (cls .page_build )
6161
6262 def test_some_plots (self ):
63- assert_true ( isdir (self .html_dir ) )
63+ assert isdir (self .html_dir )
6464
6565 def plot_file (num ):
6666 return pjoin (self .html_dir , 'some_plots-{0}.png' .format (num ))
6767
6868 range_10 , range_6 , range_4 = [plot_file (i ) for i in range (1 , 4 )]
6969 # Plot 5 is range(6) plot
70- assert_true ( file_same (range_6 , plot_file (5 ) ))
70+ assert file_same (range_6 , plot_file (5 ))
7171 # Plot 7 is range(4) plot
72- assert_true ( file_same (range_4 , plot_file (7 ) ))
72+ assert file_same (range_4 , plot_file (7 ))
7373 # Plot 11 is range(10) plot
74- assert_true ( file_same (range_10 , plot_file (11 ) ))
74+ assert file_same (range_10 , plot_file (11 ))
7575 # Plot 12 uses the old range(10) figure and the new range(6) figure
76- assert_true ( file_same (range_10 , plot_file ('12_00' ) ))
77- assert_true ( file_same (range_6 , plot_file ('12_01' ) ))
76+ assert file_same (range_10 , plot_file ('12_00' ))
77+ assert file_same (range_6 , plot_file ('12_01' ))
7878 # Plot 13 shows close-figs in action
79- assert_true ( file_same (range_4 , plot_file (13 ) ))
79+ assert file_same (range_4 , plot_file (13 ))
8080 # Plot 14 has included source
8181 with open (pjoin (self .html_dir , 'some_plots.html' ), 'rb' ) as fobj :
8282 html_contents = fobj .read ()
83- assert_true ( b'# Only a comment' in html_contents )
83+ assert b'# Only a comment' in html_contents
8484 # check plot defined in external file.
85- assert_true ( file_same (range_4 , pjoin (self .html_dir , 'range4.png' ) ))
86- assert_true ( file_same (range_6 , pjoin (self .html_dir , 'range6.png' ) ))
85+ assert file_same (range_4 , pjoin (self .html_dir , 'range4.png' ))
86+ assert file_same (range_6 , pjoin (self .html_dir , 'range6.png' ))
8787 # check if figure caption made it into html file
88- assert_true ( b'This is the caption for plot 15.' in html_contents )
88+ assert b'This is the caption for plot 15.' in html_contents
0 commit comments