7
7
8
8
from subprocess import call , Popen , PIPE
9
9
10
- from nose import SkipTest
11
- from nose .tools import assert_true
10
+ import pytest
12
11
13
12
HERE = dirname (__file__ )
14
13
TINY_PAGES = pjoin (HERE , 'tinypages' )
@@ -19,7 +18,7 @@ def setup():
19
18
try :
20
19
ret = call (['sphinx-build' , '--help' ], stdout = PIPE , stderr = PIPE )
21
20
except OSError :
22
- raise SkipTest ('Need sphinx-build on path for these tests' )
21
+ raise pytest . skip ('Need sphinx-build on path for these tests' )
23
22
if ret != 0 :
24
23
raise RuntimeError ('sphinx-build does not return 0' )
25
24
@@ -62,29 +61,29 @@ def teardown_class(cls):
62
61
shutil .rmtree (cls .page_build )
63
62
64
63
def test_some_plots (self ):
65
- assert_true ( isdir (self .html_dir ) )
64
+ assert isdir (self .html_dir )
66
65
67
66
def plot_file (num ):
68
67
return pjoin (self .html_dir , 'some_plots-{0}.png' .format (num ))
69
68
70
69
range_10 , range_6 , range_4 = [plot_file (i ) for i in range (1 , 4 )]
71
70
# Plot 5 is range(6) plot
72
- assert_true ( file_same (range_6 , plot_file (5 ) ))
71
+ assert file_same (range_6 , plot_file (5 ))
73
72
# Plot 7 is range(4) plot
74
- assert_true ( file_same (range_4 , plot_file (7 ) ))
73
+ assert file_same (range_4 , plot_file (7 ))
75
74
# Plot 11 is range(10) plot
76
- assert_true ( file_same (range_10 , plot_file (11 ) ))
75
+ assert file_same (range_10 , plot_file (11 ))
77
76
# Plot 12 uses the old range(10) figure and the new range(6) figure
78
- assert_true ( file_same (range_10 , plot_file ('12_00' ) ))
79
- assert_true ( file_same (range_6 , plot_file ('12_01' ) ))
77
+ assert file_same (range_10 , plot_file ('12_00' ))
78
+ assert file_same (range_6 , plot_file ('12_01' ))
80
79
# Plot 13 shows close-figs in action
81
- assert_true ( file_same (range_4 , plot_file (13 ) ))
80
+ assert file_same (range_4 , plot_file (13 ))
82
81
# Plot 14 has included source
83
82
with open (pjoin (self .html_dir , 'some_plots.html' ), 'rt' ) as fobj :
84
83
html_contents = fobj .read ()
85
- assert_true ( '# Only a comment' in html_contents )
84
+ assert '# Only a comment' in html_contents
86
85
# check plot defined in external file.
87
- assert_true ( file_same (range_4 , pjoin (self .html_dir , 'range4.png' ) ))
88
- assert_true ( file_same (range_6 , pjoin (self .html_dir , 'range6.png' ) ))
86
+ assert file_same (range_4 , pjoin (self .html_dir , 'range4.png' ))
87
+ assert file_same (range_6 , pjoin (self .html_dir , 'range6.png' ))
89
88
# check if figure caption made it into html file
90
- assert_true ( 'This is the caption for plot 15.' in html_contents )
89
+ assert 'This is the caption for plot 15.' in html_contents
0 commit comments