pytest-dev / pytest

The pytest framework makes it easy to write small tests, yet scales to support complex functional testing
https://pytest.org
MIT License
12.18k stars 2.7k forks source link

6.2.4: pytest is failing with INTERNALERROR on testing `genty` #9030

Closed kloczek closed 3 years ago

kloczek commented 3 years ago

I'm trying to package genty module as rpm packag. So I'm using typical in such case build, install and test cycle used on building package from non-root account:

test/test_genty_args.py ............ [ 12%] test/test_genty_dataset.py ............ [ 25%] test/test_example.py . INTERNALERROR> Traceback (most recent call last): INTERNALERROR> File "/usr/lib/python3.8/site-packages/_pytest/main.py", line 269, in wrap_session INTERNALERROR> session.exitstatus = doit(config, session) or 0 INTERNALERROR> File "/usr/lib/python3.8/site-packages/_pytest/main.py", line 323, in _main INTERNALERROR> config.hook.pytest_runtestloop(session=session) INTERNALERROR> File "/usr/lib/python3.8/site-packages/pluggy/hooks.py", line 286, in call INTERNALERROR> return self._hookexec(self, self.get_hookimpls(), kwargs) INTERNALERROR> File "/usr/lib/python3.8/site-packages/pluggy/manager.py", line 93, in _hookexec INTERNALERROR> return self._inner_hookexec(hook, methods, kwargs) INTERNALERROR> File "/usr/lib/python3.8/site-packages/pluggy/manager.py", line 84, in INTERNALERROR> self._inner_hookexec = lambda hook, methods, kwargs: hook.multicall( INTERNALERROR> File "/usr/lib/python3.8/site-packages/pluggy/callers.py", line 208, in _multicall INTERNALERROR> return outcome.get_result() INTERNALERROR> File "/usr/lib/python3.8/site-packages/pluggy/callers.py", line 80, in get_result INTERNALERROR> raise ex[1].with_traceback(ex[2]) INTERNALERROR> File "/usr/lib/python3.8/site-packages/pluggy/callers.py", line 187, in _multicall INTERNALERROR> res = hook_impl.function(args) INTERNALERROR> File "/usr/lib/python3.8/site-packages/_pytest/main.py", line 348, in pytest_runtestloop INTERNALERROR> item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) INTERNALERROR> File "/usr/lib/python3.8/site-packages/pluggy/hooks.py", line 286, in call INTERNALERROR> return self._hookexec(self, self.get_hookimpls(), kwargs) INTERNALERROR> File "/usr/lib/python3.8/site-packages/pluggy/manager.py", line 93, in _hookexec INTERNALERROR> return self._inner_hookexec(hook, methods, kwargs) INTERNALERROR> File "/usr/lib/python3.8/site-packages/pluggy/manager.py", line 84, in INTERNALERROR> self._inner_hookexec = lambda hook, methods, kwargs: hook.multicall( INTERNALERROR> File "/usr/lib/python3.8/site-packages/pluggy/callers.py", line 208, in _multicall INTERNALERROR> return outcome.get_result() INTERNALERROR> File "/usr/lib/python3.8/site-packages/pluggy/callers.py", line 80, in get_result INTERNALERROR> raise ex[1].with_traceback(ex[2]) INTERNALERROR> File "/usr/lib/python3.8/site-packages/pluggy/callers.py", line 187, in _multicall INTERNALERROR> res = hook_impl.function(args) INTERNALERROR> File "/usr/lib/python3.8/site-packages/flaky/flaky_pytest_plugin.py", line 89, in pytest_runtest_protocol INTERNALERROR> self.runner.pytest_runtest_protocol(item, nextitem) INTERNALERROR> File "/usr/lib/python3.8/site-packages/_pytest/runner.py", line 108, in pytest_runtest_protocol INTERNALERROR> ihook.pytest_runtest_logstart(nodeid=item.nodeid, location=item.location) INTERNALERROR> File "/usr/lib64/python3.8/functools.py", line 967, in get INTERNALERROR> val = self.func(instance) INTERNALERROR> File "/usr/lib/python3.8/site-packages/_pytest/nodes.py", line 587, in location INTERNALERROR> location = self.reportinfo() INTERNALERROR> File "/usr/lib/python3.8/site-packages/_pytest/python.py", line 340, in reportinfo INTERNALERROR> fspath, lineno = getfslineno(obj) INTERNALERROR> File "/usr/lib/python3.8/site-packages/_pytest/_code/code.py", line 1194, in getfslineno INTERNALERROR> obj = get_real_func(obj) INTERNALERROR> File "/usr/lib/python3.8/site-packages/_pytest/compat.py", line 271, in get_real_func INTERNALERROR> raise ValueError( INTERNALERROR> ValueError: could not find real function of <function ExampleTests.test_example_of_repeat at 0x7fb9861c9c10> INTERNALERROR> stopped at <function ExampleTests.test_example_of_repeat at 0x7fb9861c9c10>

============================================================================ 25 passed in 0.37s ============================================================================ pytest-xprocess reminder::Be sure to terminate the started process by running 'pytest --xkill' if you have not explicitly done so in your fixture with 'xprocess.getinfo().terminate()'.


list of installed modules
```console
[tkloczko@barrel SPECS]$ pip list
Package                           Version
--------------------------------- -------------------
aiofiles                          0.6.0
aiohttp                           3.7.4.post0
aioresponses                      0.7.2
alabaster                         0.7.12
amqp                              5.0.6
ansi                              0.2.0
anyio                             3.3.0
anytree                           2.8.0
apipkg                            1.5
appdirs                           1.4.4
argcomplete                       1.12.3
argon2-cffi                       20.1.0
Arpeggio                          1.10.2
arrow                             1.1.1
asgiref                           3.4.1
asn1crypto                        1.4.0
aspectlib                         1.5.2
astor                             0.8.1
astroid                           2.6.6
async-generator                   1.10
async-timeout                     3.0.1
atomicwrites                      1.4.0
attrs                             21.2.0
autoapi                           2.0.1
autodocsumm                       0.2.6
autoflake                         1.4
Automat                           20.2.0
Babel                             2.9.1
backcall                          0.2.0
backports.entry-points-selectable 1.1.0
bcrypt                            3.2.0
Beaker                            1.11.0
beautifulsoup4                    4.9.3
betamax                           0.8.1
billiard                          3.6.4.0
black                             21.5b1
bleach                            4.0.0
blinker                           1.4
blivet                            3.4.1
boto3                             1.18.26
botocore                          1.21.26
bottle                            0.12.19
breathe                           4.30.0
Brlapi                            0.8.0
Brotli                            1.0.7
cachetools                        4.2.2
cairocffi                         1.2.0
CairoSVG                          2.5.2
cbor2                             5.4.0
CCColUtils                        1.5
certifi                           2021.5.30
cffi                              1.14.6
cfgv                              3.2.0
chai                              1.1.2
changelog                         0.5.5
characteristic                    14.3.0
chardet                           4.0.0
charset-normalizer                2.0.4
cheroot                           8.5.2
click                             8.0.1
click-completion                  0.5.2
click-default-group               1.2.2
click-didyoumean                  0.0.3
click-log                         0.3.2
codespell                         2.1.0
colorama                          0.4.4
colorlog                          5.0.1
commonmark                        0.9.0
constantly                        15.1.0
contextlib2                       21.6.0
contextvars                       2.4
convertdate                       2.3.2
cov-core                          1.15.0
coverage                          5.6b1
coveralls                         3.2.0
cppy                              1.1.0
cram                              0.7
cryptography                      3.3.1
cryptography-vectors              3.4.7
cssselect                         1.1.0
cssselect2                        0.4.1
curio                             1.5
cycler                            0.10.0
Cython                            0.29.24
dateparser                        0.7.4
dateutils                         0.6.12
dbus-python                       1.2.16
ddt                               1.4.2
decopatch                         1.4.8
decorator                         5.0.8
defusedxml                        0.7.1
dictdiffer                        0.9.0
distlib                           0.3.1
distro                            1.5.0
Django                            3.2.2
dnspython                         2.1.0
docopt                            0.6.2
docutils                          0.17.1
docutils-stubs                    0.0.21
dogtail                           0.9.11
dpcontracts                       0.6.0
dpkt                              1.9.6
dulwich                           0.20.23
editdistance                      0.5.3
editdistance-s                    1.0.0
elasticsearch                     7.11.0
elementpath                       2.2.3
entrypoints                       0.3
evdev                             1.4.0
eventlet                          0.31.1
exam                              0.10.6
execnet                           1.9.0
extras                            1.0.0
factory-boy                       3.2.0
Faker                             8.11.0
fido2                             0.9.1
fields                            5.0.0
filelock                          3.0.12
fixtures                          3.0.0
flake8                            3.9.2
flake8-bugbear                    21.4.3
flake8-pie                        0.14.0
flaky                             3.7.0
Flask                             2.0.1
flit                              3.3.0
flit_core                         3.3.0
fluidity-sm                       0.2.0
fonttools                         4.26.2
freezegun                         1.0.0
func-timeout                      4.4.0
future                            0.18.2
fuzzywuzzy                        0.18.0
gcovr                             5.0
Genshi                            0.7.5
genty                             1.3.2
gevent                            21.8.0
geventhttpclient                  1.5.1
gi-docgen                         2021.7
gitdb                             4.0.7
GitPython                         3.1.20
google                            3.0.0
gpg                               1.16.0-unknown
gprof2dot                         2021.2.21
greenlet                          1.1.1
guzzle-sphinx-theme               0.7.11
h11                               0.12.0
h2                                4.1.0+dev
hacking                           4.0.0
hidapi                            0.10.1
hpack                             4.0.0
html2text                         2020.1.16
html5lib                          1.1
httmock                           1.4.0
httpbin                           0.7.0
httplib2                          0.19.1
humanize                          3.7.1
Hypercorn                         0.11.2
hyperframe                        6.0.1
hyperlink                         21.0.0
hypothesis                        6.14.6
hypothesmith                      0.1.8
identify                          2.2.13
idna                              3.2
ifaddr                            0.1.7
imagesize                         1.2.0
immutables                        0.15
importlib-metadata                4.6.4
incremental                       21.3.0
inflect                           5.3.0
iniconfig                         1.1.1
invoke                            1.5.0
iocapture                         0.1.2
ipykernel                         6.0.3
ipyparallel                       6.3.0
ipython                           7.25.0
ipython_genutils                  0.2.0
ipywidgets                        7.6.3
iso8601                           0.1.16
isodate                           0.6.0
isort                             5.9.3
itsdangerous                      2.0.1
jaraco.classes                    3.2.1
jaraco.collections                3.4.0
jaraco.envs                       2.1.1
jaraco.functools                  3.3.0
jaraco.itertools                  6.0.1
jaraco.packaging                  8.2.1
jaraco.path                       3.3.1
jaraco.text                       3.5.1
javapackages                      5.3.0
jedi                              0.18.0
Jinja2                            3.0.1
jinja2-pluralize                  0.3.0
jmespath                          0.10.0
Js2Py                             0.71
jsonschema                        3.2.0
jupyter-client                    6.2.0
jupyter-core                      4.7.1
jupyter-sphinx                    0.3.2
jupyterlab-pygments               0.1.2
jupytext                          1.11.4
kiwisolver                        1.3.1
kombu                             5.1.0
lark-parser                       0.11.3
latexcodec                        2.0.1
lazy-object-proxy                 1.6.0
lexicon                           1.0.0
libcomps                          0.1.17
libcst                            0.3.20
libevdev                          0.9
linecache2                        1.0.0
linkify-it-py                     1.0.1
lit                               12.0.1.dev0
lockfile                          0.12.2
louis                             3.18.0
lxml                              4.6.3
makefun                           1.11.3
Mako                              1.1.5.dev0
mallard-ducktype                  1.0.2
Markdown                          3.3.4
markdown-it-py                    1.1.0
MarkupSafe                        2.0.1
matplotlib-inline                 0.1.2
mccabe                            0.6.1
mdit-py-plugins                   0.2.8
meson                             0.59.1
metaextract                       1.0.7
mistune                           0.8.4
mock                              4.0.3
more-itertools                    8.8.0
msgpack                           1.0.2
mujson                            1.4
multidict                         5.1.0
multipledispatch                  0.6.0
mypy                              0.910
mypy-extensions                   0.4.3
myst-parser                       0.15.1
nbclient                          0.5.3
nbconvert                         6.1.0
nbformat                          5.1.3
nbsphinx                          0.8.7
nest-asyncio                      1.5.1
netaddr                           0.8.0
nftables                          0.1
nocasedict                        1.0.2
nocaselist                        1.0.4
nodeenv                           1.6.0
nose2                             0.10.0
notebook                          6.4.2
ntplib                            0.4.0
numpy                             1.18.2
numpydoc                          1.1.0
objproxies                        0.9.4
olefile                           0.46
openidc-client                    0.6.0
openstackdocstheme                2.3.0
ordered-set                       4.0.2
outcome                           1.1.0
packaging                         21.0
Pallets-Sphinx-Themes             2.0.1
pandas                            1.3.1
pandocfilters                     1.4.3
parameterized                     0.8.1
paramiko                          2.7.2
parso                             0.8.0
parver                            0.3.1
Paste                             3.5.0
PasteDeploy                       2.1.1
path                              16.2.0
pathspec                          0.9.0
pbr                               5.6.0
pcapy                             0.11.4
pep517                            0.11.0
pexpect                           4.8.0
pickleshare                       0.7.5
pid                               3.0.4
Pillow                            8.3.1
pip                               21.2.4
platformdirs                      2.2.0
pluggy                            0.13.1
ply                               3.11
pocketlint                        0.21
poetry-core                       1.0.3
polib                             1.1.1
pproxy                            2.7.8
pre-commit                        2.14.0
pretend                           1.0.9
prettytable                       0.7.2
priority                          2.0.0
process-tests                     2.1.1
productmd                         1.33
prometheus-client                 0.11.0
prompt-toolkit                    3.0.19
psutil                            5.8.0
ptyprocess                        0.7.0
purl                              1.5
pwquality                         1.4.4
py                                1.10.0
py-cpuinfo                        8.0.0
py2pack                           0.8.7
pyasn1                            0.4.8
pyasn1-modules                    0.2.8
pybind11                          2.7.1
pybtex                            0.24.0
pybtex-docutils                   1.0.1
pycairo                           1.18.2
pycodestyle                       2.7.0
pycparser                         2.20
pycrypto                          2.6.1
pycups                            1.9.74
pycurl                            7.43.0.5
pydantic                          1.8.2
pydocstyle                        6.1.1
pyenchant                         3.2.1
pyfakefs                          4.5.0
pyflakes                          2.3.1
pyftpdlib                         1.5.6
pygal                             3.0.0.dev1
Pygments                          2.10.0.dev20210815
pygments-ansi-color               0.0.6
pygments-pytest                   2.2.0
PyGObject                         3.40.1
PyHamcrest                        2.0.2
pyinotify                         0.9.6
pyjsparser                        2.7.1
pykickstart                       3.34
pylama                            7.7.1
pylast                            3.3.0
pylint                            2.9.6
pylons-sphinx-themes              1.0.13
PyMeeus                           0.5.11
PyNaCl                            1.4.0
pyOpenSSL                         20.0.1
pyparsing                         2.4.6
pyparted                          3.11.5
pypi-search                       1.2.1
PyQt5                             5.14.2
PyQt5_sip                         4.19.22
pyquery                           1.4.4.dev0
pyrad                             2.4
pyrsistent                        0.18.0
pyscard                           2.0.1
pyScss                            1.3.7
pyserial                          3.4
PySocks                           1.7.1
pytest                            6.2.4
pytest-asyncio                    0.15.1
pytest-benchmark                  3.4.1
pytest-black                      0.3.12
pytest-cases                      3.6.3
pytest_check                      1.0.1
pytest-checkdocs                  2.7.1
pytest-cov                        2.12.1
pytest-datadir                    1.3.1
pytest-expect                     1.1.0
pytest-fixture-config             1.7.0
pytest-flake8                     1.0.7
pytest-forked                     1.3.0
pytest-freezegun                  0.4.2
pytest-httpbin                    1.0.0
pytest-isort                      2.0.0
pytest-mock                       3.6.1
pytest-profiling                  1.7.0
pytest-randomly                   3.8.0
pytest-regressions                2.2.0
pytest-rerunfailures              9.1.1
pytest-runner                     5.3.2
pytest-shutil                     1.7.0
pytest-subtests                   0.5.0
pytest-timeout                    1.4.2
pytest-toolbox                    0.5
pytest-trio                       0.7.0
pytest-virtualenv                 1.7.0
pytest-xdist                      2.3.0
pytest-xprocess                   0.18.1
python-augeas                     1.1.0
python-dateutil                   2.8.1
python-dbusmock                   0.23.1
python-mimeparse                  1.6.0
python-socks                      1.2.4
python-xlib                       0.31
pytz                              2021.1
pyudev                            0.22.0
pyusb                             1.2.1
pywbem                            1.1.3
pyxattr                           0.7.2
pyxdg                             0.27
PyYAML                            5.4.1
pyzmq                             22.2.1
raven                             6.10.0
rdflib                            6.0.0
re-assert                         1.1.0
readthedocs-sphinx-ext            2.1.4
recommonmark                      0.7.1
redis                             3.5.3
regex                             2021.7.6
releases                          1.6.3
reno                              3.2.0
repoze.sphinx.autointerface       0.8
requests                          2.26.0
requests_download                 0.1.2
requests-file                     1.5.1
requests-ftp                      0.3.1
requests-mock                     1.9.3
requests-toolbelt                 0.9.1
requests-unixsocket               0.2.0
responses                         0.13.3
rich                              10.7.0
rpm                               4.16.1.3
rsa                               4.7.2
rst.linker                        2.2.0
s3transfer                        0.5.0
SCons                             4.2.0
scour                             0.38.2
scripttest                        1.3
selenium                          4.0.0a1
selinux                           3.2
semantic-version                  2.8.5
Send2Trash                        1.8.0
service-identity                  21.1.0
setuptools                        57.4.0.post20210812
setuptools-git                    1.2
setuptools-scm                    6.0.1
setuptools-scm-git-archive        1.1
sh                                1.14.2
shellingham                       1.4.0
should-dsl                        2.1.2
simpleline                        1.8
six                               1.16.0
slip                              0.6.5
slip.dbus                         0.6.5
smartypants                       2.0.1
smbus                             1.1
smmap                             4.0.0
sniffio                           1.2.0
snowballstemmer                   2.1.0
solaar                            1.0.6
sortedcontainers                  2.1.0
sos                               4.2
soupsieve                         2.2.1
spec                              1.4.1
Sphinx                            4.1.2
sphinx-argparse                   0.2.5
sphinx-argparse-cli               1.7.0
sphinx-autodoc-typehints          1.12.0
sphinx-celery                     2.0.0
sphinx-click                      3.0.1
sphinx-copybutton                 0.4.0
sphinx-gallery                    0.9.0
sphinx-hoverxref                  0.7b1
sphinx_inline_tabs                2021.4.11b9
sphinx-issues                     1.2.0
sphinx-last-updated-by-git        0.3.0
sphinx-lv2-theme                  1.0.0
sphinx-markdown-tables            0.0.15
sphinx-paramlinks                 0.5.1
sphinx-prompt                     1.4.0
sphinx-py3doc-enhanced-theme      2.4.0
sphinx-removed-in                 0.2.1
sphinx-rst-builder                0.0.3
sphinx-rtd-theme                  0.5.2
sphinx-selective-exclude          1.0.3
sphinx-tabs                       3.1.0
sphinx-typlog-theme               0.8.0
sphinxcontrib-apidoc              0.3.0
sphinxcontrib-applehelp           1.0.2.dev20210802
sphinxcontrib-asyncio             0.3.0
sphinxcontrib-autoprogram         0.1.7
sphinxcontrib-bibtex              2.3.0
sphinxcontrib-devhelp             1.0.2.dev20210801
sphinxcontrib_github_alt          1.2
sphinxcontrib-htmlhelp            2.0.0
sphinxcontrib-httpdomain          1.7.0
sphinxcontrib-jsmath              1.0.1.dev20210801
sphinxcontrib-log-cabinet         1.0.1
sphinxcontrib-programoutput       0.17
sphinxcontrib-qthelp              1.0.2
sphinxcontrib-restbuilder         0.3
sphinxcontrib-serializinghtml     1.1.5
sphinxcontrib-spelling            7.2.1
sphinxcontrib-svg2pdfconverter    1.1.1
sphinxcontrib-towncrier           0.2.0a0
sphinxcontrib-trio                1.1.2
sphinxcontrib-websupport          1.2.4
sphinxext-opengraph               0.4.2
sphobjinv                         2.1
SQLAlchemy                        1.4.22
sqlparse                          0.4.2.dev0
stdio-mgr                         1.0.1
stdlib-list                       0.8.0
stem                              1.8.0
stone                             3.2.1
strategies                        0.2.3
sure                              2.0.0
sybil                             2.0.1
systemd-python                    234
tabulate                          0.8.9
Tempita                           0.5.2
tempora                           4.1.1
termcolor                         1.1.0
terminado                         0.11.1
test-server                       0.0.31
testpath                          0.5.0
testresources                     2.0.1
testscenarios                     0.5.0
testtools                         2.5.0
text-unidecode                    1.3
texttable                         1.6.4
tinycss2                          1.1.0
toml                              0.10.2
tomli                             1.1.0
tomlkit                           0.7.2
toolz                             0.11.1
tornado                           6.1
towncrier                         21.3.0
tox                               3.14.6
traceback2                        1.4.0
traitlets                         5.0.5
transaction                       3.0.1
trio                              0.19.0
trustme                           0.8.0
Twisted                           21.2.0
typed-ast                         1.4.3
typing-extensions                 3.10.0.0
typing-inspect                    0.7.1
typogrify                         2.0.7
tzlocal                           2.1
u-msgpack-python                  2.7.1
uc-micro-py                       1.0.1
ujson                             4.1.0
Unidecode                         1.2.0
unittest-mixins                   1.6
uritemplate                       3.0.1
urllib3                           1.26.6
userpath                          1.7.0
uTidylib                          0.7
uvicorn                           0.13.4
uvloop                            0.15.3
validators                        0.18.1
vine                              5.0.0
virtualenv                        20.6.0
waitress                          1.4.4
watchgod                          0.7
wcwidth                           0.2.5
webcolors                         1.11.1
webencodings                      0.5.1
WebOb                             1.8.7
websocket-client                  1.2.1
websockets                        9.1
WebTest                           3.0.0
Werkzeug                          2.0.1
wheel                             0.37.0
Whoosh                            2.7.4
widgetsnbextension                3.5.1
wrapt                             1.12.1
WSGIProxy2                        0.5.0
wsproto                           1.0.0
xcffib                            0.11.1
xmlschema                         1.7.0
xmltodict                         0.12.0
yamlloader                        1.0.0
yarl                              1.6.3
youtube-dl                        2021.6.6
zc.lockfile                       2.0
zeroconf                          0.36.0
zerorpc                           0.6.3
zipp                              3.5.0
zope.event                        4.5.0
zope.interface                    5.4.0
zope.testing                      4.9
zzzeeksphinx                      1.2.3
bluetech commented 3 years ago

The genty test suite doesn't use pytest, it uses unittest, so for the testing step in your packaging I recommend running unittest instead of pytest, as the genty project intends, then it should work.

pytest does have unittest compatibility, but which appears not to work well for this test suite. If you meant to report that, then we can have a further look.

kloczek commented 3 years ago

pytest does have unittest compatibility, but which appears not to work well for this test suite. If you meant to report that, then we can have a further look.

OK, so what I should do? Did I not report that in this case pytest "appears not work well"? (kidding :P)

Nevertheless pytest code have been trying to test that and something went wrong :/ .. which may be simptom of some bug unrelatet do fact that pytast has nor unittest compatybility .. (?)

RonnyPfannschmidt commented 3 years ago

Genty completely messes around in the class

IMHO pytest should not be responsible for the mess