diff options
Diffstat (limited to 'tests/test_build_latex.py')
-rw-r--r-- | tests/test_build_latex.py | 37 |
1 files changed, 9 insertions, 28 deletions
diff --git a/tests/test_build_latex.py b/tests/test_build_latex.py index a7fa95168..534270e45 100644 --- a/tests/test_build_latex.py +++ b/tests/test_build_latex.py @@ -841,10 +841,8 @@ def test_latex_table(app, status, warning): # table having :widths: option table = tables['table having :widths: option'] - assert ('\\noindent\\begin{tabulary}{\\linewidth}{' - '|p{\\dimexpr(\\linewidth-\\arrayrulewidth)*30/100-2\\tabcolsep-\\arrayrulewidth\\relax}' - '|p{\\dimexpr(\\linewidth-\\arrayrulewidth)*70/100-2\\tabcolsep-\\arrayrulewidth\\relax}|}' - in table) + assert ('\\noindent\\begin{tabulary}{\\linewidth}' + '{|\\X{30}{100}|\\X{70}{100}|}' in table) assert ('\\hline\n' '\\sphinxstylethead{\\relax \nheader1\n\\unskip}\\relax &' '\\sphinxstylethead{\\relax \nheader2\n\\unskip}\\relax' in table) @@ -869,22 +867,15 @@ def test_latex_table(app, status, warning): # table having verbatim table = tables['table having verbatim'] - assert ('\\noindent\\begin{tabular}{|*{2}{' - 'p{\\dimexpr(\\linewidth-\\arrayrulewidth)/2-2\\tabcolsep-\\arrayrulewidth\\relax}|}}\n' - '\\hline' in table) + assert ('\\noindent\\begin{tabular}{|*{2}{\\X{1}{2}|}}\n\\hline' in table) # table having problematic cell table = tables['table having problematic cell'] - assert ('\\noindent\\begin{tabular}{|*{2}{' - 'p{\\dimexpr(\\linewidth-\\arrayrulewidth)/2-2\\tabcolsep-\\arrayrulewidth\\relax}|}}\n' - '\\hline' in table) + assert ('\\noindent\\begin{tabular}{|*{2}{\\X{1}{2}|}}\n\\hline' in table) # table having both :widths: and problematic cell table = tables['table having both :widths: and problematic cell'] - assert ('\\noindent\\begin{tabular}{' - '|p{\\dimexpr(\\linewidth-\\arrayrulewidth)*30/100-2\\tabcolsep-\\arrayrulewidth\\relax}' - '|p{\\dimexpr(\\linewidth-\\arrayrulewidth)*70/100-2\\tabcolsep-\\arrayrulewidth\\relax}|}' - in table) + assert ('\\noindent\\begin{tabular}{|\\X{30}{100}|\\X{70}{100}|}' in table) # longtable table = tables['longtable'] @@ -909,10 +900,7 @@ def test_latex_table(app, status, warning): # longtable having :widths: option table = tables['longtable having :widths: option'] - assert ('\\begin{longtable}{' - '|p{\\dimexpr(\\linewidth-\\arrayrulewidth)*30/100-2\\tabcolsep-\\arrayrulewidth\\relax}' - '|p{\\dimexpr(\\linewidth-\\arrayrulewidth)*70/100-2\\tabcolsep-\\arrayrulewidth\\relax}|}' - in table) + assert ('\\begin{longtable}{|\\X{30}{100}|\\X{70}{100}|}' in table) # longtable having caption table = tables['longtable having caption'] @@ -921,19 +909,12 @@ def test_latex_table(app, status, warning): # longtable having verbatim table = tables['longtable having verbatim'] - assert ('\\begin{longtable}{|*{2}{' - 'p{\\dimexpr(\\linewidth-\\arrayrulewidth)/2-2\\tabcolsep-\\arrayrulewidth\\relax}|}}\n' - '\\hline' in table) + assert ('\\begin{longtable}{|*{2}{\\X{1}{2}|}}\n\\hline' in table) # longtable having problematic cell table = tables['longtable having problematic cell'] - assert ('\\begin{longtable}{|*{2}{' - 'p{\\dimexpr(\\linewidth-\\arrayrulewidth)/2-2\\tabcolsep-\\arrayrulewidth\\relax}|}}\n' - '\\hline' in table) + assert ('\\begin{longtable}{|*{2}{\\X{1}{2}|}}\n\\hline' in table) # longtable having both :widths: and problematic cell table = tables['longtable having both :widths: and problematic cell'] - assert ('\\begin{longtable}{' - '|p{\\dimexpr(\\linewidth-\\arrayrulewidth)*30/100-2\\tabcolsep-\\arrayrulewidth\\relax}' - '|p{\\dimexpr(\\linewidth-\\arrayrulewidth)*70/100-2\\tabcolsep-\\arrayrulewidth\\relax}|}' - in table) + assert ('\\begin{longtable}{|\\X{30}{100}|\\X{70}{100}|}' in table) |