Closed DimStar77 closed 2 years ago
Thanks. Can you re-try with the master
master branch if d43eea79cb9be87424014fd37201319d4eadd9de fixes this?
I think this should be fixed in new 0.19.1 release: closing -- please re-open if this still comes up.
Not sure if you'd rather want a different issue, but the test suite still fails, now with a different error though:
________________________________ ERROR collecting graphviz/backend/rendering.py ________________________________
/usr/lib64/python3.8/doctest.py:939: in find
self._find(tests, obj, name, module, source_lines, globs, {})
/usr/lib/python3.8/site-packages/_pytest/doctest.py:522: in _find
doctest.DocTestFinder._find( # type: ignore
/usr/lib64/python3.8/doctest.py:1001: in _find
self._find(tests, val, valname, module, source_lines,
/usr/lib/python3.8/site-packages/_pytest/doctest.py:522: in _find
doctest.DocTestFinder._find( # type: ignore
/usr/lib64/python3.8/doctest.py:989: in _find
test = self._get_test(obj, name, module, globs, source_lines)
/usr/lib64/python3.8/doctest.py:1073: in _get_test
return self._parser.get_doctest(docstring, globs, name,
/usr/lib64/python3.8/doctest.py:675: in get_doctest
return DocTest(self.get_examples(string, name), globs,
/usr/lib64/python3.8/doctest.py:689: in get_examples
return [x for x in self.parse(string, name)
/usr/lib64/python3.8/doctest.py:651: in parse
self._parse_example(m, name, lineno)
/usr/lib64/python3.8/doctest.py:732: in _parse_example
options = self._find_options(source, name, lineno)
/usr/lib64/python3.8/doctest.py:761: in _find_options
raise ValueError('line %r of the doctest for %s '
E ValueError: line 12 of the doctest for graphviz.backend.rendering.infer_format has an invalid option: '+NO_EXE'
Thanks. Let's keep it here for now.
graphviz.backend.rendering.infer_format has an invalid option: '+NO_EXE'
Can you maybe provide more information how exactly you are running the tests?
The directory from which the tests are started (project root) should contain conftest.py.
run-tests.py defines the doctest option that this complains about.
Sure - I'm building packages for openSUSE Tumbleweed, currently in my test branch found at https://build.opensuse.org/package/show/home:dimstar:Factory/python-graphviz
A full build log (incl test run) can be found at https://build.opensuse.org/package/live_build_log/home:dimstar:Factory/python-graphviz/openSUSE_Factory/x86_64
I might have found something - our tooling by default runs 'pytest' directly, which does not take tun-tests.py into account; running python3 run-tests.py makes the tests pass, so I'd say 'all is good'; sorry for the noise
our tooling by default runs 'pytest' directly, which does not take tun-tests.py into account
Thanks. +1 that this should be it (see spec file).
For context: We moved the pytest
command line options to conftest.py
in the project root so we do not need to repeat that inside docs
and graphviz
for running specific doctests only (there is still some repetition to make build-docs.py -b doctest
work in docs/conf.py). It has the drawback that pytest
adds the project root to sys.path
so that e.g. on tox
it does not test the installed version (some use the src
layout for this reason). I still want to experiment a bit to see if there is a better solution.
Now that we got rid of docs/conftest.py
and graphviz/conftest.py
I think we can also move the doctest flag handling from run-test.py
over to conftest.py
in the project root which should fix running pytest
directly instead of run-test.py
.
Can you check if this branch would work with your setup?
Can you check if this branch would work with your setup?
With this branch, I can use our default %pytest macro and it passes.
For me, both options are valid: adding that patch (if you consider adding this to the tree) or running run-tests.py; the spec file can easily accommodate to that too (just took me a bit to figure out that 'just' running pytest would not work for this package; no biggie)
Thanks. +1 that run-tests.py
is the recommended/official way to run the tests, but if we can fix bare pytest
running with 961dbdd607399e264a752a73df874f686538d949 for the next version then SG to do that, merged to master.
somehow on my system (openSUSE Tumbleweed, i.e. rolling distro), the test suite of this package (version 0.19) fails with:
Used pytest 6.2.5