Skip to content

Instantly share code, notes, and snippets.

@akrabat
Created June 7, 2020 11:39
Show Gist options
  • Save akrabat/433b30a5fcdccd1b182d8afce8ea92df to your computer and use it in GitHub Desktop.
Save akrabat/433b30a5fcdccd1b182d8afce8ea92df to your computer and use it in GitHub Desktop.
rob@swiftsure rst2pdf {rst2pdf-tox} (stephenfin/tox-integration) $ tox -e py37
py37 create: /Users/rob/Projects/python/rst2pdf/.tox/py37
py37 installdeps: -crequirements.txt, pytest, pytest-xdist, coverage
py37 develop-inst: /Users/rob/Projects/python/rst2pdf
py37 installed: aafigure==0.6,alabaster==0.7.12,apipkg==1.5,attrs==19.3.0,Babel==2.8.0,certifi==2020.4.5.2,chardet==3.0.4,coverage==5.1,cssselect2==0.3.0,cycler==0.10.0,docutils==0.16,execnet==1.7.1,html5lib==1.0.1,idna==2.9,imagesize==1.2.0,importlib-metadata==1.6.1,Jinja2==2.11.2,kiwisolver==1.2.0,lxml==4.5.1,MarkupSafe==1.1.1,matplotlib==3.2.1,more-itertools==8.3.0,numpy==1.18.5,packaging==19.0,pdfrw==0.4,Pillow==7.1.2,pluggy==0.13.1,py==1.8.1,Pygments==2.6.1,PyMuPDF==1.17.0,pyparsing==2.4.0,PyPDF2==1.26.0,pytest==5.4.3,pytest-forked==1.1.3,pytest-xdist==1.32.0,python-dateutil==2.8.1,pytz==2020.1,reportlab==3.5.42,requests==2.23.0,-e git+git@github.com:akrabat/rst2pdf.git@3e14c22b57b8e8bc7133dffde6eeaa741d40a47e#egg=rst2pdf,six==1.12.0,smartypants==2.0.1,snowballstemmer==2.0.0,Sphinx==3.0.4,sphinxcontrib-applehelp==1.0.2,sphinxcontrib-devhelp==1.0.2,sphinxcontrib-htmlhelp==1.0.3,sphinxcontrib-jsmath==1.0.1,sphinxcontrib-qthelp==1.0.3,sphinxcontrib-serializinghtml==1.1.4,svglib==1.0.0,tinycss2==1.0.2,urllib3==1.25.9,wcwidth==0.2.3,webencodings==0.5.1,xhtml2pdf==0.2.4,zipp==3.1.0
py37 run-test-pre: PYTHONHASHSEED='881834738'
py37 run-test: commands[0] | pytest -n auto
=============================================================== test session starts ===============================================================
platform darwin -- Python 3.7.7, pytest-5.4.3, py-1.8.1, pluggy-0.13.1
cachedir: .tox/py37/.pytest_cache
rootdir: /Users/rob/Projects/python/rst2pdf
plugins: forked-1.1.3, xdist-1.32.0
gw0 [308] / gw1 [308] / gw2 [308] / gw3 [308] / gw4 [308] / gw5 [308] / gw6 [308] / gw7 [308]
................................F........s.....F...........................s...ss.s..........F....................................ss.s..... [ 45%]
...s...s.....s...........s.......s.......s...ss..........s..........ssss..................s.....................s...............s.....s.... [ 90%]
....s..F.....F.....s.FF.....F. [100%]
==================================================================== FAILURES =====================================================================
________________________________________________________________ test_fancytitles _________________________________________________________________
[gw2] darwin -- Python 3.7.7 /Users/rob/Projects/python/rst2pdf/.tox/py37/bin/python
cls = <class '_pytest.runner.CallInfo'>, func = <function call_runtest_hook.<locals>.<lambda> at 0x10e62e320>, when = 'call'
reraise = (<class '_pytest.outcomes.Exit'>, <class 'KeyboardInterrupt'>)
@classmethod
def from_call(cls, func, when, reraise=None) -> "CallInfo":
#: context of invocation: one of "setup", "call",
#: "teardown", "memocollect"
start = time()
excinfo = None
try:
> result = func()
.tox/py37/lib/python3.7/site-packages/_pytest/runner.py:244:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> lambda: ihook(item=item, **kwds), when=when, reraise=reraise
)
.tox/py37/lib/python3.7/site-packages/_pytest/runner.py:217:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_HookCaller 'pytest_runtest_call'>, args = (), kwargs = {'item': <TxtItem test_fancytitles>}, notincall = set()
def __call__(self, *args, **kwargs):
if args:
raise TypeError("hook calling supports only keyword arguments")
assert not self.is_historic()
if self.spec and self.spec.argnames:
notincall = (
set(self.spec.argnames) - set(["__multicall__"]) - set(kwargs.keys())
)
if notincall:
warnings.warn(
"Argument(s) {} which are declared in the hookspec "
"can not be found in this hook call".format(tuple(notincall)),
stacklevel=2,
)
> return self._hookexec(self, self.get_hookimpls(), kwargs)
.tox/py37/lib/python3.7/site-packages/pluggy/hooks.py:286:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.config.PytestPluginManager object at 0x10d4892d0>, hook = <_HookCaller 'pytest_runtest_call'>
methods = [<HookImpl plugin_name='runner', plugin=<module '_pytest.runner' from '/Users/rob/Projects/python/rst2pdf/.tox/py37/li..._fixture=None>>, <HookImpl plugin_name='logging-plugin', plugin=<_pytest.logging.LoggingPlugin object at 0x10d8ccb90>>]
kwargs = {'item': <TxtItem test_fancytitles>}
def _hookexec(self, hook, methods, kwargs):
# called from all hookcaller instances.
# enable_tracing will set its own wrapping function at self._inner_hookexec
> return self._inner_hookexec(hook, methods, kwargs)
.tox/py37/lib/python3.7/site-packages/pluggy/manager.py:93:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
hook = <_HookCaller 'pytest_runtest_call'>
methods = [<HookImpl plugin_name='runner', plugin=<module '_pytest.runner' from '/Users/rob/Projects/python/rst2pdf/.tox/py37/li..._fixture=None>>, <HookImpl plugin_name='logging-plugin', plugin=<_pytest.logging.LoggingPlugin object at 0x10d8ccb90>>]
kwargs = {'item': <TxtItem test_fancytitles>}
self._inner_hookexec = lambda hook, methods, kwargs: hook.multicall(
methods,
kwargs,
> firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
)
.tox/py37/lib/python3.7/site-packages/pluggy/manager.py:87:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
hook_impls = [<HookImpl plugin_name='runner', plugin=<module '_pytest.runner' from '/Users/rob/Projects/python/rst2pdf/.tox/py37/li..._fixture=None>>, <HookImpl plugin_name='logging-plugin', plugin=<_pytest.logging.LoggingPlugin object at 0x10d8ccb90>>]
caller_kwargs = {'item': <TxtItem test_fancytitles>}, firstresult = False
def _multicall(hook_impls, caller_kwargs, firstresult=False):
"""Execute a call into multiple python functions/methods and return the
result(s).
``caller_kwargs`` comes from _HookCaller.__call__().
"""
__tracebackhide__ = True
results = []
excinfo = None
try: # run impl and wrapper setup functions in a loop
teardowns = []
try:
for hook_impl in reversed(hook_impls):
try:
args = [caller_kwargs[argname] for argname in hook_impl.argnames]
except KeyError:
for argname in hook_impl.argnames:
if argname not in caller_kwargs:
raise HookCallError(
"hook call must provide argument %r" % (argname,)
)
if hook_impl.hookwrapper:
try:
gen = hook_impl.function(*args)
next(gen) # first yield
teardowns.append(gen)
except StopIteration:
_raise_wrapfail(gen, "did not yield")
else:
res = hook_impl.function(*args)
if res is not None:
results.append(res)
if firstresult: # halt further impl calls
break
except BaseException:
excinfo = sys.exc_info()
finally:
if firstresult: # first result hooks return a single value
outcome = _Result(results[0] if results else None, excinfo)
else:
outcome = _Result(results, excinfo)
# run all wrapper post-yield blocks
for gen in reversed(teardowns):
try:
gen.send(outcome)
_raise_wrapfail(gen, "has second yield")
except StopIteration:
pass
> return outcome.get_result()
.tox/py37/lib/python3.7/site-packages/pluggy/callers.py:208:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pluggy.callers._Result object at 0x10e748a90>
def get_result(self):
"""Get the result(s) for this hook call.
If the hook was marked as a ``firstresult`` only a single value
will be returned otherwise a list of results.
"""
__tracebackhide__ = True
if self._excinfo is None:
return self._result
else:
ex = self._excinfo
if _py3:
> raise ex[1].with_traceback(ex[2])
.tox/py37/lib/python3.7/site-packages/pluggy/callers.py:80:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
hook_impls = [<HookImpl plugin_name='runner', plugin=<module '_pytest.runner' from '/Users/rob/Projects/python/rst2pdf/.tox/py37/li..._fixture=None>>, <HookImpl plugin_name='logging-plugin', plugin=<_pytest.logging.LoggingPlugin object at 0x10d8ccb90>>]
caller_kwargs = {'item': <TxtItem test_fancytitles>}, firstresult = False
def _multicall(hook_impls, caller_kwargs, firstresult=False):
"""Execute a call into multiple python functions/methods and return the
result(s).
``caller_kwargs`` comes from _HookCaller.__call__().
"""
__tracebackhide__ = True
results = []
excinfo = None
try: # run impl and wrapper setup functions in a loop
teardowns = []
try:
for hook_impl in reversed(hook_impls):
try:
args = [caller_kwargs[argname] for argname in hook_impl.argnames]
except KeyError:
for argname in hook_impl.argnames:
if argname not in caller_kwargs:
raise HookCallError(
"hook call must provide argument %r" % (argname,)
)
if hook_impl.hookwrapper:
try:
gen = hook_impl.function(*args)
next(gen) # first yield
teardowns.append(gen)
except StopIteration:
_raise_wrapfail(gen, "did not yield")
else:
> res = hook_impl.function(*args)
.tox/py37/lib/python3.7/site-packages/pluggy/callers.py:187:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
item = <TxtItem test_fancytitles>
def pytest_runtest_call(item):
_update_current_test_var(item, "call")
try:
del sys.last_type
del sys.last_value
del sys.last_traceback
except AttributeError:
pass
try:
item.runtest()
except Exception as e:
# Store trace info to allow postmortem debugging
sys.last_type = type(e)
sys.last_value = e
assert e.__traceback__ is not None
# Skip *this* frame
sys.last_traceback = e.__traceback__.tb_next
> raise e
.tox/py37/lib/python3.7/site-packages/_pytest/runner.py:143:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
item = <TxtItem test_fancytitles>
def pytest_runtest_call(item):
_update_current_test_var(item, "call")
try:
del sys.last_type
del sys.last_value
del sys.last_traceback
except AttributeError:
pass
try:
> item.runtest()
.tox/py37/lib/python3.7/site-packages/_pytest/runner.py:135:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <TxtItem test_fancytitles>
def runtest(self):
__tracebackhide__ = True
# if '.ignore' file present, skip test
ignore_file = os.path.join(INPUT_DIR, self.name + '.ignore')
if os.path.exists(ignore_file):
with open(ignore_file) as fh:
ignore_reason = fh.read()
pytest.skip(ignore_reason)
# run the actual test
> retcode, output = self._build()
rst2pdf/tests/conftest.py:138:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <TxtItem test_fancytitles>
def _build(self):
input_ref = self.name + '.txt'
output_pdf = os.path.join(OUTPUT_DIR, self.name + '.pdf')
output_log = os.path.join(OUTPUT_DIR, self.name + '.log')
for path in (output_log, output_pdf):
if os.path.exists(path):
if os.path.isdir(path):
shutil.rmtree(path)
else:
os.remove(path)
cmd = ['rst2pdf', '--date-invariant', '-v', input_ref]
cli_file = os.path.join(INPUT_DIR, self.name + '.cli')
if os.path.exists(cli_file):
with open(cli_file) as fh:
cmd += shlex.split(fh.read())
style_file = os.path.join(INPUT_DIR, self.name + '.style')
if os.path.exists(style_file):
cmd += ['-s', os.path.basename(style_file)]
cmd += ['-o', output_pdf]
try:
output = subprocess.check_output(
cmd, cwd=INPUT_DIR, stderr=subprocess.STDOUT,
)
retcode = 0
except subprocess.CalledProcessError as exc:
output = exc.output
retcode = exc.returncode
with open(output_log, 'wb') as fh:
fh.write(output)
output_file = os.path.join(OUTPUT_DIR, self.name + '.pdf')
no_pdf = os.path.exists(os.path.join(INPUT_DIR, self.name + '.nopdf'))
if not os.path.exists(output_file):
> assert no_pdf, 'File %s not generated' % os.path.basename(
output_file
)
E AssertionError: File test_fancytitles.pdf not generated
E assert False
rst2pdf/tests/conftest.py:231: AssertionError
__________________________________________________________________ test_inkscape __________________________________________________________________
[gw4] darwin -- Python 3.7.7 /Users/rob/Projects/python/rst2pdf/.tox/py37/bin/python
cls = <class '_pytest.runner.CallInfo'>, func = <function call_runtest_hook.<locals>.<lambda> at 0x10c598680>, when = 'call'
reraise = (<class '_pytest.outcomes.Exit'>, <class 'KeyboardInterrupt'>)
@classmethod
def from_call(cls, func, when, reraise=None) -> "CallInfo":
#: context of invocation: one of "setup", "call",
#: "teardown", "memocollect"
start = time()
excinfo = None
try:
> result = func()
.tox/py37/lib/python3.7/site-packages/_pytest/runner.py:244:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> lambda: ihook(item=item, **kwds), when=when, reraise=reraise
)
.tox/py37/lib/python3.7/site-packages/_pytest/runner.py:217:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_HookCaller 'pytest_runtest_call'>, args = (), kwargs = {'item': <TxtItem test_inkscape>}, notincall = set()
def __call__(self, *args, **kwargs):
if args:
raise TypeError("hook calling supports only keyword arguments")
assert not self.is_historic()
if self.spec and self.spec.argnames:
notincall = (
set(self.spec.argnames) - set(["__multicall__"]) - set(kwargs.keys())
)
if notincall:
warnings.warn(
"Argument(s) {} which are declared in the hookspec "
"can not be found in this hook call".format(tuple(notincall)),
stacklevel=2,
)
> return self._hookexec(self, self.get_hookimpls(), kwargs)
.tox/py37/lib/python3.7/site-packages/pluggy/hooks.py:286:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.config.PytestPluginManager object at 0x10b3f32d0>, hook = <_HookCaller 'pytest_runtest_call'>
methods = [<HookImpl plugin_name='runner', plugin=<module '_pytest.runner' from '/Users/rob/Projects/python/rst2pdf/.tox/py37/li..._fixture=None>>, <HookImpl plugin_name='logging-plugin', plugin=<_pytest.logging.LoggingPlugin object at 0x10b836b90>>]
kwargs = {'item': <TxtItem test_inkscape>}
def _hookexec(self, hook, methods, kwargs):
# called from all hookcaller instances.
# enable_tracing will set its own wrapping function at self._inner_hookexec
> return self._inner_hookexec(hook, methods, kwargs)
.tox/py37/lib/python3.7/site-packages/pluggy/manager.py:93:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
hook = <_HookCaller 'pytest_runtest_call'>
methods = [<HookImpl plugin_name='runner', plugin=<module '_pytest.runner' from '/Users/rob/Projects/python/rst2pdf/.tox/py37/li..._fixture=None>>, <HookImpl plugin_name='logging-plugin', plugin=<_pytest.logging.LoggingPlugin object at 0x10b836b90>>]
kwargs = {'item': <TxtItem test_inkscape>}
self._inner_hookexec = lambda hook, methods, kwargs: hook.multicall(
methods,
kwargs,
> firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
)
.tox/py37/lib/python3.7/site-packages/pluggy/manager.py:87:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
hook_impls = [<HookImpl plugin_name='runner', plugin=<module '_pytest.runner' from '/Users/rob/Projects/python/rst2pdf/.tox/py37/li..._fixture=None>>, <HookImpl plugin_name='logging-plugin', plugin=<_pytest.logging.LoggingPlugin object at 0x10b836b90>>]
caller_kwargs = {'item': <TxtItem test_inkscape>}, firstresult = False
def _multicall(hook_impls, caller_kwargs, firstresult=False):
"""Execute a call into multiple python functions/methods and return the
result(s).
``caller_kwargs`` comes from _HookCaller.__call__().
"""
__tracebackhide__ = True
results = []
excinfo = None
try: # run impl and wrapper setup functions in a loop
teardowns = []
try:
for hook_impl in reversed(hook_impls):
try:
args = [caller_kwargs[argname] for argname in hook_impl.argnames]
except KeyError:
for argname in hook_impl.argnames:
if argname not in caller_kwargs:
raise HookCallError(
"hook call must provide argument %r" % (argname,)
)
if hook_impl.hookwrapper:
try:
gen = hook_impl.function(*args)
next(gen) # first yield
teardowns.append(gen)
except StopIteration:
_raise_wrapfail(gen, "did not yield")
else:
res = hook_impl.function(*args)
if res is not None:
results.append(res)
if firstresult: # halt further impl calls
break
except BaseException:
excinfo = sys.exc_info()
finally:
if firstresult: # first result hooks return a single value
outcome = _Result(results[0] if results else None, excinfo)
else:
outcome = _Result(results, excinfo)
# run all wrapper post-yield blocks
for gen in reversed(teardowns):
try:
gen.send(outcome)
_raise_wrapfail(gen, "has second yield")
except StopIteration:
pass
> return outcome.get_result()
.tox/py37/lib/python3.7/site-packages/pluggy/callers.py:208:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pluggy.callers._Result object at 0x10b85b090>
def get_result(self):
"""Get the result(s) for this hook call.
If the hook was marked as a ``firstresult`` only a single value
will be returned otherwise a list of results.
"""
__tracebackhide__ = True
if self._excinfo is None:
return self._result
else:
ex = self._excinfo
if _py3:
> raise ex[1].with_traceback(ex[2])
.tox/py37/lib/python3.7/site-packages/pluggy/callers.py:80:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
hook_impls = [<HookImpl plugin_name='runner', plugin=<module '_pytest.runner' from '/Users/rob/Projects/python/rst2pdf/.tox/py37/li..._fixture=None>>, <HookImpl plugin_name='logging-plugin', plugin=<_pytest.logging.LoggingPlugin object at 0x10b836b90>>]
caller_kwargs = {'item': <TxtItem test_inkscape>}, firstresult = False
def _multicall(hook_impls, caller_kwargs, firstresult=False):
"""Execute a call into multiple python functions/methods and return the
result(s).
``caller_kwargs`` comes from _HookCaller.__call__().
"""
__tracebackhide__ = True
results = []
excinfo = None
try: # run impl and wrapper setup functions in a loop
teardowns = []
try:
for hook_impl in reversed(hook_impls):
try:
args = [caller_kwargs[argname] for argname in hook_impl.argnames]
except KeyError:
for argname in hook_impl.argnames:
if argname not in caller_kwargs:
raise HookCallError(
"hook call must provide argument %r" % (argname,)
)
if hook_impl.hookwrapper:
try:
gen = hook_impl.function(*args)
next(gen) # first yield
teardowns.append(gen)
except StopIteration:
_raise_wrapfail(gen, "did not yield")
else:
> res = hook_impl.function(*args)
.tox/py37/lib/python3.7/site-packages/pluggy/callers.py:187:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
item = <TxtItem test_inkscape>
def pytest_runtest_call(item):
_update_current_test_var(item, "call")
try:
del sys.last_type
del sys.last_value
del sys.last_traceback
except AttributeError:
pass
try:
item.runtest()
except Exception as e:
# Store trace info to allow postmortem debugging
sys.last_type = type(e)
sys.last_value = e
assert e.__traceback__ is not None
# Skip *this* frame
sys.last_traceback = e.__traceback__.tb_next
> raise e
.tox/py37/lib/python3.7/site-packages/_pytest/runner.py:143:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
item = <TxtItem test_inkscape>
def pytest_runtest_call(item):
_update_current_test_var(item, "call")
try:
del sys.last_type
del sys.last_value
del sys.last_traceback
except AttributeError:
pass
try:
> item.runtest()
.tox/py37/lib/python3.7/site-packages/_pytest/runner.py:135:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <TxtItem test_inkscape>
def runtest(self):
__tracebackhide__ = True
# if '.ignore' file present, skip test
ignore_file = os.path.join(INPUT_DIR, self.name + '.ignore')
if os.path.exists(ignore_file):
with open(ignore_file) as fh:
ignore_reason = fh.read()
pytest.skip(ignore_reason)
# run the actual test
> retcode, output = self._build()
rst2pdf/tests/conftest.py:138:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <TxtItem test_inkscape>
def _build(self):
input_ref = self.name + '.txt'
output_pdf = os.path.join(OUTPUT_DIR, self.name + '.pdf')
output_log = os.path.join(OUTPUT_DIR, self.name + '.log')
for path in (output_log, output_pdf):
if os.path.exists(path):
if os.path.isdir(path):
shutil.rmtree(path)
else:
os.remove(path)
cmd = ['rst2pdf', '--date-invariant', '-v', input_ref]
cli_file = os.path.join(INPUT_DIR, self.name + '.cli')
if os.path.exists(cli_file):
with open(cli_file) as fh:
cmd += shlex.split(fh.read())
style_file = os.path.join(INPUT_DIR, self.name + '.style')
if os.path.exists(style_file):
cmd += ['-s', os.path.basename(style_file)]
cmd += ['-o', output_pdf]
try:
output = subprocess.check_output(
cmd, cwd=INPUT_DIR, stderr=subprocess.STDOUT,
)
retcode = 0
except subprocess.CalledProcessError as exc:
output = exc.output
retcode = exc.returncode
with open(output_log, 'wb') as fh:
fh.write(output)
output_file = os.path.join(OUTPUT_DIR, self.name + '.pdf')
no_pdf = os.path.exists(os.path.join(INPUT_DIR, self.name + '.nopdf'))
if not os.path.exists(output_file):
> assert no_pdf, 'File %s not generated' % os.path.basename(
output_file
)
E AssertionError: File test_inkscape.pdf not generated
E assert False
rst2pdf/tests/conftest.py:231: AssertionError
________________________________________________________________ test_issue_239_2 _________________________________________________________________
[gw5] darwin -- Python 3.7.7 /Users/rob/Projects/python/rst2pdf/.tox/py37/bin/python
cls = <class '_pytest.runner.CallInfo'>, func = <function call_runtest_hook.<locals>.<lambda> at 0x10d18e4d0>, when = 'call'
reraise = (<class '_pytest.outcomes.Exit'>, <class 'KeyboardInterrupt'>)
@classmethod
def from_call(cls, func, when, reraise=None) -> "CallInfo":
#: context of invocation: one of "setup", "call",
#: "teardown", "memocollect"
start = time()
excinfo = None
try:
> result = func()
.tox/py37/lib/python3.7/site-packages/_pytest/runner.py:244:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
> lambda: ihook(item=item, **kwds), when=when, reraise=reraise
)
.tox/py37/lib/python3.7/site-packages/_pytest/runner.py:217:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_HookCaller 'pytest_runtest_call'>, args = (), kwargs = {'item': <TxtItem test_issue_239_2>}, notincall = set()
def __call__(self, *args, **kwargs):
if args:
raise TypeError("hook calling supports only keyword arguments")
assert not self.is_historic()
if self.spec and self.spec.argnames:
notincall = (
set(self.spec.argnames) - set(["__multicall__"]) - set(kwargs.keys())
)
if notincall:
warnings.warn(
"Argument(s) {} which are declared in the hookspec "
"can not be found in this hook call".format(tuple(notincall)),
stacklevel=2,
)
> return self._hookexec(self, self.get_hookimpls(), kwargs)
.tox/py37/lib/python3.7/site-packages/pluggy/hooks.py:286:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <_pytest.config.PytestPluginManager object at 0x10bef22d0>, hook = <_HookCaller 'pytest_runtest_call'>
methods = [<HookImpl plugin_name='runner', plugin=<module '_pytest.runner' from '/Users/rob/Projects/python/rst2pdf/.tox/py37/li..._fixture=None>>, <HookImpl plugin_name='logging-plugin', plugin=<_pytest.logging.LoggingPlugin object at 0x10c43fb90>>]
kwargs = {'item': <TxtItem test_issue_239_2>}
def _hookexec(self, hook, methods, kwargs):
# called from all hookcaller instances.
# enable_tracing will set its own wrapping function at self._inner_hookexec
> return self._inner_hookexec(hook, methods, kwargs)
.tox/py37/lib/python3.7/site-packages/pluggy/manager.py:93:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
hook = <_HookCaller 'pytest_runtest_call'>
methods = [<HookImpl plugin_name='runner', plugin=<module '_pytest.runner' from '/Users/rob/Projects/python/rst2pdf/.tox/py37/li..._fixture=None>>, <HookImpl plugin_name='logging-plugin', plugin=<_pytest.logging.LoggingPlugin object at 0x10c43fb90>>]
kwargs = {'item': <TxtItem test_issue_239_2>}
self._inner_hookexec = lambda hook, methods, kwargs: hook.multicall(
methods,
kwargs,
> firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
)
.tox/py37/lib/python3.7/site-packages/pluggy/manager.py:87:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
hook_impls = [<HookImpl plugin_name='runner', plugin=<module '_pytest.runner' from '/Users/rob/Projects/python/rst2pdf/.tox/py37/li..._fixture=None>>, <HookImpl plugin_name='logging-plugin', plugin=<_pytest.logging.LoggingPlugin object at 0x10c43fb90>>]
caller_kwargs = {'item': <TxtItem test_issue_239_2>}, firstresult = False
def _multicall(hook_impls, caller_kwargs, firstresult=False):
"""Execute a call into multiple python functions/methods and return the
result(s).
``caller_kwargs`` comes from _HookCaller.__call__().
"""
__tracebackhide__ = True
results = []
excinfo = None
try: # run impl and wrapper setup functions in a loop
teardowns = []
try:
for hook_impl in reversed(hook_impls):
try:
args = [caller_kwargs[argname] for argname in hook_impl.argnames]
except KeyError:
for argname in hook_impl.argnames:
if argname not in caller_kwargs:
raise HookCallError(
"hook call must provide argument %r" % (argname,)
)
if hook_impl.hookwrapper:
try:
gen = hook_impl.function(*args)
next(gen) # first yield
teardowns.append(gen)
except StopIteration:
_raise_wrapfail(gen, "did not yield")
else:
res = hook_impl.function(*args)
if res is not None:
results.append(res)
if firstresult: # halt further impl calls
break
except BaseException:
excinfo = sys.exc_info()
finally:
if firstresult: # first result hooks return a single value
outcome = _Result(results[0] if results else None, excinfo)
else:
outcome = _Result(results, excinfo)
# run all wrapper post-yield blocks
for gen in reversed(teardowns):
try:
gen.send(outcome)
_raise_wrapfail(gen, "has second yield")
except StopIteration:
pass
> return outcome.get_result()
.tox/py37/lib/python3.7/site-packages/pluggy/callers.py:208:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pluggy.callers._Result object at 0x10d26d710>
def get_result(self):
"""Get the result(s) for this hook call.
If the hook was marked as a ``firstresult`` only a single value
will be returned otherwise a list of results.
"""
__tracebackhide__ = True
if self._excinfo is None:
return self._result
else:
ex = self._excinfo
if _py3:
> raise ex[1].with_traceback(ex[2])
.tox/py37/lib/python3.7/site-packages/pluggy/callers.py:80:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
hook_impls = [<HookImpl plugin_name='runner', plugin=<module '_pytest.runner' from '/Users/rob/Projects/python/rst2pdf/.tox/py37/li..._fixture=None>>, <HookImpl plugin_name='logging-plugin', plugin=<_pytest.logging.LoggingPlugin object at 0x10c43fb90>>]
caller_kwargs = {'item': <TxtItem test_issue_239_2>}, firstresult = False
def _multicall(hook_impls, caller_kwargs, firstresult=False):
"""Execute a call into multiple python functions/methods and return the
result(s).
``caller_kwargs`` comes from _HookCaller.__call__().
"""
__tracebackhide__ = True
results = []
excinfo = None
try: # run impl and wrapper setup functions in a loop
teardowns = []
try:
for hook_impl in reversed(hook_impls):
try:
args = [caller_kwargs[argname] for argname in hook_impl.argnames]
except KeyError:
for argname in hook_impl.argnames:
if argname not in caller_kwargs:
raise HookCallError(
"hook call must provide argument %r" % (argname,)
)
if hook_impl.hookwrapper:
try:
gen = hook_impl.function(*args)
next(gen) # first yield
teardowns.append(gen)
except StopIteration:
_raise_wrapfail(gen, "did not yield")
else:
> res = hook_impl.function(*args)
.tox/py37/lib/python3.7/site-packages/pluggy/callers.py:187:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
item = <TxtItem test_issue_239_2>
def pytest_runtest_call(item):
_update_current_test_var(item, "call")
try:
del sys.last_type
del sys.last_value
del sys.last_traceback
except AttributeError:
pass
try:
item.runtest()
except Exception as e:
# Store trace info to allow postmortem debugging
sys.last_type = type(e)
sys.last_value = e
assert e.__traceback__ is not None
# Skip *this* frame
sys.last_traceback = e.__traceback__.tb_next
> raise e
.tox/py37/lib/python3.7/site-packages/_pytest/runner.py:143:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
item = <TxtItem test_issue_239_2>
def pytest_runtest_call(item):
_update_current_test_var(item, "call")
try:
del sys.last_type
del sys.last_value
del sys.last_traceback
except AttributeError:
pass
try:
> item.runtest()
.tox/py37/lib/python3.7/site-packages/_pytest/runner.py:135:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <TxtItem test_issue_239_2>
def runtest(self):
__tracebackhide__ = True
# if '.ignore' file present, skip test
ignore_file = os.path.join(INPUT_DIR, self.name + '.ignore')
if os.path.exists(ignore_file):
with open(ignore_file) as fh:
ignore_reason = fh.read()
pytest.skip(ignore_reason)
# run the actual test
> retcode, output = self._build()
rst2pdf/tests/conftest.py:138:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <TxtItem test_issue_239_2>
def _build(self):
input_ref = self.name + '.txt'
output_pdf = os.path.join(OUTPUT_DIR, self.name + '.pdf')
output_log = os.path.join(OUTPUT_DIR, self.name + '.log')
for path in (output_log, output_pdf):
if os.path.exists(path):
if os.path.isdir(path):
shutil.rmtree(path)
else:
os.remove(path)
cmd = ['rst2pdf', '--date-invariant', '-v', input_ref]
cli_file = os.path.join(INPUT_DIR, self.name + '.cli')
if os.path.exists(cli_file):
with open(cli_file) as fh:
cmd += shlex.split(fh.read())
style_file = os.path.join(INPUT_DIR, self.name + '.style')
if os.path.exists(style_file):
cmd += ['-s', os.path.basename(style_file)]
cmd += ['-o', output_pdf]
try:
output = subprocess.check_output(
cmd, cwd=INPUT_DIR, stderr=subprocess.STDOUT,
)
retcode = 0
except subprocess.CalledProcessError as exc:
output = exc.output
retcode = exc.returncode
with open(output_log, 'wb') as fh:
fh.write(output)
output_file = os.path.join(OUTPUT_DIR, self.name + '.pdf')
no_pdf = os.path.exists(os.path.join(INPUT_DIR, self.name + '.nopdf'))
if not os.path.exists(output_file):
> assert no_pdf, 'File %s not generated' % os.path.basename(
output_file
)
E AssertionError: File test_issue_239_2.pdf not generated
E assert False
rst2pdf/tests/conftest.py:231: AssertionError
_________________________________________________________________ sphinx-issue172 _________________________________________________________________
[gw7] darwin -- Python 3.7.7 /Users/rob/Projects/python/rst2pdf/.tox/py37/bin/python
conftest.CompareException: assert 7 == 11
+ where 7 = len([(40.015750885009766, 41.450340270996094, 92.2557601928711, 68.99034118652344, 'Index', 0, ...), (40.015750885009766, ... (module)', 4, ...), (40.015750885009766, 178.77435302734375, 48.019752502441406, 195.3583526611328, 'S', 5, ...), ...])
+ and 11 = len([(40.015750885009766, 41.450340270996094, 92.2557601928711, 68.99034118652344, 'Index', 0, ...), (40.015750885009766, ..., 'module', 4, ...), (60.015750885009766, 165.900390625, 86.13574981689453, 179.64039611816406, 'parrot', 5, ...), ...])
_________________________________________________________________ sphinx-issue318 _________________________________________________________________
[gw2] darwin -- Python 3.7.7 /Users/rob/Projects/python/rst2pdf/.tox/py37/bin/python
conftest.CompareException: assert 19 == 27
+ where 19 = len([(40.015750885009766, 41.450340270996094, 92.2557601928711, 68.99034118652344, 'Index', 0, ...), (40.015750885009766, ... function)', 4, ...), (40.015750885009766, 178.77435302734375, 48.67974853515625, 195.3583526611328, 'H', 5, ...), ...])
+ and 27 = len([(40.015750885009766, 41.450340270996094, 92.2557601928711, 68.99034118652344, 'Index', 0, ...), (40.015750885009766, ..., ...), (60.015750885009766, 165.900390625, 143.37574768066406, 179.64039611816406, 'format_exception()', 5, ...), ...])
_________________________________________________________________ sphinx-issue320 _________________________________________________________________
[gw3] darwin -- Python 3.7.7 /Users/rob/Projects/python/rst2pdf/.tox/py37/bin/python
conftest.CompareException: assert 4 == 3
+ where 4 = len([(40.015750885009766, 41.450340270996094, 126.6757583618164, 68.99034118652344, 'Contents', 0, ...), (40.0157508850097...on 1 1', 2, ...), (60.015750885009766, 111.100341796875, 555.2598266601562, 124.84033966064453, 'Section 2 1', 3, ...)])
+ and 3 = len([(40.015750885009766, 41.450340270996094, 126.6757583618164, 68.99034118652344, 'Contents', 0, ...), (40.0157508850097...entation! 1', 1, ...), (60.015750885009766, 93.100341796875, 555.2598266601562, 106.84033966064453, 'Stuff 1', 2, ...)])
_________________________________________________________________ sphinx-issue319 _________________________________________________________________
[gw2] darwin -- Python 3.7.7 /Users/rob/Projects/python/rst2pdf/.tox/py37/bin/python
conftest.CompareException: assert 2 == 3
+ where 2 = len([(40.015750885009766, 41.450340270996094, 126.6757583618164, 68.99034118652344, 'Contents', 0, ...), (40.015750885009766, 75.15034484863281, 555.2598266601562, 88.92034149169922, 'Stuff 1', 1, ...)])
+ and 3 = len([(40.015750885009766, 41.450340270996094, 126.6757583618164, 68.99034118652344, 'Contents', 0, ...), (40.0157508850097...entation! 1', 1, ...), (60.015750885009766, 93.100341796875, 555.2598266601562, 106.84033966064453, 'Stuff 1', 2, ...)])
____________________________________________________________ sphinx-repeat-table-rows _____________________________________________________________
[gw2] darwin -- Python 3.7.7 /Users/rob/Projects/python/rst2pdf/.tox/py37/bin/python
conftest.CompareException: assert 4 == 3
+ where 4 = len([[(40.015750885009766, 41.450340270996094, 126.6757583618164, 68.99034118652344, 'Contents', 0, ...), (40.015750885009...15750885009766, 133.100341796875, 128.8157501220703, 158.84034729003906, 'Lorem ipsum dolor\nsit amet.', 5, ...), ...]])
+ and 3 = len([[(40.015750885009766, 41.450340270996094, 126.6757583618164, 68.99034118652344, 'Contents', 0, ...), (40.015750885009...peat_table_rows', 2, ...), (34.015750885009766, 806.4625854492188, 39.57575225830078, 820.2025756835938, '1', 3, ...)]])
============================================================= short test summary info =============================================================
FAILED rst2pdf/tests/input/test_fancytitles.txt::test_fancytitles - AssertionError: File test_fancytitles.pdf not generated
FAILED rst2pdf/tests/input/test_inkscape.txt::test_inkscape - AssertionError: File test_inkscape.pdf not generated
FAILED rst2pdf/tests/input/test_issue_239_2.txt::test_issue_239_2 - AssertionError: File test_issue_239_2.pdf not generated
FAILED rst2pdf/tests/input/sphinx-issue172/conf.py::sphinx-issue172
FAILED rst2pdf/tests/input/sphinx-issue318/conf.py::sphinx-issue318
FAILED rst2pdf/tests/input/sphinx-issue320/conf.py::sphinx-issue320
FAILED rst2pdf/tests/input/sphinx-issue319/conf.py::sphinx-issue319
FAILED rst2pdf/tests/input/sphinx-repeat-table-rows/conf.py::sphinx-repeat-table-rows
============================================== 8 failed, 273 passed, 27 skipped in 98.51s (0:01:38) ===============================================
ERROR: InvocationError for command /Users/rob/Projects/python/rst2pdf/.tox/py37/bin/pytest -n auto (exited with code 1)
_____________________________________________________________________ summary _____________________________________________________________________
ERROR: py37: commands failed
rob@swiftsure rst2pdf {rst2pdf-tox} (stephenfin/tox-integration) $
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment