Skip to content

Commit

Permalink
reduced failing example
Browse files Browse the repository at this point in the history
  • Loading branch information
abukaj committed Jun 7, 2017
1 parent 9a09410 commit a4a23ce
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 128 deletions.
29 changes: 15 additions & 14 deletions tests/test_pweave.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,26 +18,27 @@
class WeaveTest(RegressionTest):
def _testGenerator(name, doctype, filename, kwargs={}, python={2, 3}):
def testMethod(self):
self.TESTDIR = os.path.join('weave', doctype)
infile = self.absPathTo(filename + 'w')
self.setNewOutfile(filename)
for _ in range(1000):
self.TESTDIR = os.path.join('weave', doctype)
infile = self.absPathTo(filename + 'w')
self.setNewOutfile(filename)

pweave.weave(infile, doctype=doctype, **kwargs)
pweave.weave(infile, doctype=doctype, **kwargs)

basename, _, ext = filename.rpartition('.')
self.REFERENCE = self.absPathTo(basename + '_REF.' + ext)
self.assertSameAsReference()
basename, _, ext = filename.rpartition('.')
self.REFERENCE = self.absPathTo(basename + '_REF.' + ext)
self.assertSameAsReference()

testMethod.__name__ = name
return testMethod

_tests = {
'Simple': (['pandoc', 'simple.md'], {}),
'ClassInMultipleChunksUsingContinueOption': (['pandoc', 'ar_yw.md'], {}),
'InlineCode': (['pandoc', 'inline_chunks.md'], {}),
# 'Simple': (['pandoc', 'simple.md'], {}),
# 'ClassInMultipleChunksUsingContinueOption': (['pandoc', 'ar_yw.md'], {}),
# 'InlineCode': (['pandoc', 'inline_chunks.md'], {}),
'TerminalEmulation': (['tex', 'term_test.tex'], {}),
'FIR_FilterExampleTex': (['tex', 'FIR_design_verb.tex'], {}),
'WrapAndCodeOutput': (['texminted', 'wrap_test.tex'], {})
# 'FIR_FilterExampleTex': (['tex', 'FIR_design_verb.tex'], {}),
# 'WrapAndCodeOutput': (['texminted', 'wrap_test.tex'], {})
}


Expand All @@ -64,8 +65,8 @@ def testMethod(self):
return testMethod

_tests = {
'Convert': (['convert_test.txt', 'script', 'noweb', 'Pnw'], {}),
'Nbformat': (['simple.mdw', 'noweb', 'notebook', 'ipynb'], {}),
# 'Convert': (['convert_test.txt', 'script', 'noweb', 'Pnw'], {}),
# 'Nbformat': (['simple.mdw', 'noweb', 'notebook', 'ipynb'], {}),
}


Expand Down
35 changes: 0 additions & 35 deletions tests/weave/tex/nondeterministicFail.texw
Original file line number Diff line number Diff line change
@@ -1,19 +1,4 @@
<<term=True>>=
print(123)
@
<<term=True>>=
a = 42
print(a)
@
Test output.
<<term=True>>=
2 + 2 * 2 ** 2
@
<<term=True>>=
for i in range(3):
print(i)
@
<<term=True>>=
for i in range(3):
print(i)
print(i**2)
Expand Down Expand Up @@ -62,23 +47,3 @@ for i in range(3):

print(42)
@
<<term=True,name='SyntaxError'>>=
def f
print(42)
@
<<term=True,name='IndentationError'>>=
def f():
print(12)
print(8)
print(42)
@
Empty code chunk does not work

\begin{verbatim}
>>>

\end{verbatim}

End
<<term=True>>=
@
80 changes: 1 addition & 79 deletions tests/weave/tex/nondeterministicFail_REF.tex
Original file line number Diff line number Diff line change
@@ -1,41 +1,4 @@

\begin{verbatim}
print(123)
\end{verbatim}
\begin{verbatim}
123
\end{verbatim}


\begin{verbatim}
a = 42
print(a)
\end{verbatim}
\begin{verbatim}
42
\end{verbatim}

Test output.

\begin{verbatim}
2 + 2 * 2 ** 2
\end{verbatim}
\begin{verbatim}
10
\end{verbatim}


\begin{verbatim}
for i in range(3):
print(i)
\end{verbatim}
\begin{verbatim}
0
1
2
\end{verbatim}


\begin{verbatim}
for i in range(3):
print(i)
Expand Down Expand Up @@ -118,7 +81,7 @@
\end{verbatim}
\begin{verbatim}
---------------------------------------------------------------------------Exception
Traceback (most recent call last)<ipython-input-19-b0fb8d925930> in
Traceback (most recent call last)<ipython-input-10-b0fb8d925930> in
<module>()
2 print(i)
3 if i == 1:
Expand All @@ -134,44 +97,3 @@
42
\end{verbatim}


\begin{verbatim}
def f
\end{verbatim}
\begin{verbatim}
File "<ipython-input-22-b5657d2747d4>", line 1
def f
^
SyntaxError: invalid syntax
\end{verbatim}

\begin{verbatim}
print(42)
\end{verbatim}
\begin{verbatim}
42
\end{verbatim}


\begin{verbatim}
def f():
print(12)
print(8)
print(42)
\end{verbatim}
\begin{verbatim}
File "<ipython-input-25-9e9734f26d6a>", line 3
print(8)
^
IndentationError: unindent does not match any outer indentation level
\end{verbatim}

Empty code chunk does not work

\begin{verbatim}
>>>
\end{verbatim}

End

0 comments on commit a4a23ce

Please sign in to comment.