Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

INTERNALERROR> AttributeError: can't set attribute with pytest 5.4.1 #6931

Closed
2 tasks
amitverma12 opened this issue Mar 16, 2020 · 2 comments
Closed
2 tasks

Comments

@amitverma12
Copy link

amitverma12 commented Mar 16, 2020

  • Started getting the following exception after upgrading to pytest==5.4.1

$ pytest
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR> File "/data1/miniconda3/lib/python3.7/site-packages/_pytest/main.py", line 187, in wrap_session
INTERNALERROR> config._do_configure()
INTERNALERROR> File "/data1/miniconda3/lib/python3.7/site-packages/_pytest/config/init.py", line 820, in _do_configure
INTERNALERROR> self.hook.pytest_configure.call_historic(kwargs=dict(config=self))
INTERNALERROR> File "/data1/miniconda3/lib/python3.7/site-packages/pluggy/hooks.py", line 311, in call_historic
INTERNALERROR> res = self._hookexec(self, self.get_hookimpls(), kwargs)
INTERNALERROR> File "/data1/miniconda3/lib/python3.7/site-packages/pluggy/manager.py", line 87, in _hookexec
INTERNALERROR> return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR> File "/data1/miniconda3/lib/python3.7/site-packages/pluggy/manager.py", line 81, in
INTERNALERROR> firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
INTERNALERROR> File "/data1/miniconda3/lib/python3.7/site-packages/pluggy/callers.py", line 208, in _multicall
INTERNALERROR> return outcome.get_result()
INTERNALERROR> File "/data1/miniconda3/lib/python3.7/site-packages/pluggy/callers.py", line 80, in get_result
INTERNALERROR> raise ex[1].with_traceback(ex[2])
INTERNALERROR> File "/data1/miniconda3/lib/python3.7/site-packages/pluggy/callers.py", line 187, in _multicall
INTERNALERROR> res = hook_impl.function(*args)
INTERNALERROR> File "/data1/miniconda3/lib/python3.7/site-packages/pytest_sugar.py", line 176, in pytest_configure
INTERNALERROR> sugar_reporter = SugarTerminalReporter(standard_reporter)
INTERNALERROR> File "/data1/miniconda3/lib/python3.7/site-packages/pytest_sugar.py", line 214, in init
INTERNALERROR> self.writer = self._tw
INTERNALERROR> AttributeError: can't set attribute

  • output of pip list from the virtual environment you are using:

`$ pip list
Package Version


apipkg 1.5
appdirs 1.4.3
aspy.yaml 1.3.0
astroid 2.2.5
atomicwrites 1.3.0
attrs 19.3.0
avro-python3 1.9.0
backcall 0.1.0
bitarray 1.0.1
black 19.3b0
certifi 2019.11.28
cffi 1.14.0
cfgv 2.0.0
chardet 3.0.4
Click 7.0
conda 4.8.2
conda-package-handling 1.6.0
confluent-kafka 1.3.0
cryptography 2.8
Cython 0.29.13
decorator 4.3.0
docopt 0.6.2
dpath 1.4.2
entrypoints 0.3
et-xmlfile 1.0.1
execnet 1.7.1
fastavro 0.21.23
flake8 3.7.7
future 0.17.1
hdfs 2.5.8
hypothesis 5.5.1
ibis-framework 1.2.0
identify 1.4.5
idna 2.9
importlib-metadata 0.17
impyla 0.16.2
inflection 0.3.1
ipython 7.11.1
ipython-genutils 0.2.0
isort 4.3.20
javaproperties 0.5.2
JayDeBeApi 1.1.1
jdcal 1.4
jedi 0.12.1
JPype1 0.7.0
kafka-python 1.4.7
ksql 0.5.1.1
lazy-object-proxy 1.4.1
mccabe 0.6.1
more-itertools 7.0.0
multipledispatch 0.6.0
nodeenv 1.3.3
numpy 1.17.2
openpyxl 3.0.3
packaging 19.0
pandas 1.0.1
parso 0.3.1
pendulum 2.1.0
pexpect 4.6.0
pickleshare 0.7.4
pip 20.0.2
pipenv 2018.11.26
pluggy 0.12.0
ply 3.11
pre-commit 1.17.0
prompt-toolkit 2.0.9
psycopg2-binary 2.8.4
ptyprocess 0.6.0
py 1.8.0
py-spy 0.3.2
pyasn1 0.4.6
pycodestyle 2.5.0
pycosat 0.6.3
pycparser 2.20
pycryptodome 3.8.1
pyflakes 2.1.1
Pygments 2.2.0
PyHive 0.6.1
pykerberos 1.2.1
pylibmc 1.6.0
pylint 2.3.1
PyMySQL 0.9.3
pyOpenSSL 19.1.0
pyparsing 2.4.0
PySocks 1.7.1
pytest 5.3.5
pytest-base-url 1.4.1
pytest-forked 1.1.3
pytest-html 2.1.0
pytest-metadata 1.8.0
pytest-selenium 1.17.0
pytest-sugar 0.9.2
pytest-variables 1.9.0
pytest-xdist 1.31.0
python-dateutil 2.8.0
python3-ldap 0.9.8.4
pytz 2019.1
pytzdata 2019.3
PyYAML 5.1
records 0.5.3
regex 2019.8.19
requests 2.23.0
requests-kerberos 0.12.0
ruamel-yaml 0.15.80
sasl 0.2.1
selenium 3.141.0
setuptools 46.0.0.post20200311
simplegeneric 0.8.1
six 1.14.0
sortedcontainers 2.1.0
SQLAlchemy 1.3.13
tablib 1.1.0
termcolor 1.1.0
thrift 0.11.0
thrift-sasl 0.2.1
thriftpy 0.3.9
thriftpy2 0.4.0
toml 0.10.0
toolz 0.10.0
tqdm 4.43.0
traitlets 4.3.2
typed-ast 1.4.0
urllib3 1.25.7
vertica-python 0.10.2
virtualenv 16.1.0
virtualenv-clone 0.4.0
wcwidth 0.1.7
wheel 0.34.2
wrapt 1.11.2
zipp 0.5.1
`

  • pytest and operating system versions
    pytest 5.4.1
    OS - RHEL 6.10

The issue is resolved after downgrading pytest to 5.3.5

$ pytest
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR> File "/data1/miniconda3/lib/python3.7/site-packages/_pytest/main.py", line 187, in wrap_session
INTERNALERROR> config._do_configure()
INTERNALERROR> File "/data1/miniconda3/lib/python3.7/site-packages/_pytest/config/init.py", line 820, in _do_configure
INTERNALERROR> self.hook.pytest_configure.call_historic(kwargs=dict(config=self))
INTERNALERROR> File "/data1/miniconda3/lib/python3.7/site-packages/pluggy/hooks.py", line 311, in call_historic
INTERNALERROR> res = self._hookexec(self, self.get_hookimpls(), kwargs)
INTERNALERROR> File "/data1/miniconda3/lib/python3.7/site-packages/pluggy/manager.py", line 87, in _hookexec
INTERNALERROR> return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR> File "/data1/miniconda3/lib/python3.7/site-packages/pluggy/manager.py", line 81, in
INTERNALERROR> firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
INTERNALERROR> File "/data1/miniconda3/lib/python3.7/site-packages/pluggy/callers.py", line 208, in _multicall
INTERNALERROR> return outcome.get_result()
INTERNALERROR> File "/data1/miniconda3/lib/python3.7/site-packages/pluggy/callers.py", line 80, in get_result
INTERNALERROR> raise ex[1].with_traceback(ex[2])
INTERNALERROR> File "/data1/miniconda3/lib/python3.7/site-packages/pluggy/callers.py", line 187, in _multicall
INTERNALERROR> res = hook_impl.function(args)
INTERNALERROR> File "/data1/miniconda3/lib/python3.7/site-packages/pytest_sugar.py", line 176, in pytest_configure
INTERNALERROR> sugar_reporter = SugarTerminalReporter(standard_reporter)
INTERNALERROR> File "/data1/miniconda3/lib/python3.7/site-packages/pytest_sugar.py", line 214, in init
INTERNALERROR> self.writer = self._tw
INTERNALERROR> AttributeError: can't set attribute
$
$ pip install pytest==5.3.5
Collecting pytest==5.3.5
Using cached pytest-5.3.5-py3-none-any.whl (235 kB)
Requirement already satisfied: wcwidth in /data1/miniconda3/lib/python3.7/site-packages (from pytest==5.3.5) (0.1.7)
Requirement already satisfied: py>=1.5.0 in /data1/miniconda3/lib/python3.7/site-packages (from pytest==5.3.5) (1.8.0)
Requirement already satisfied: importlib-metadata>=0.12; python_version < "3.8" in /data1/miniconda3/lib/python3.7/site-packages (from pytest==5.3.5) (0.17)
Requirement already satisfied: attrs>=17.4.0 in /data1/miniconda3/lib/python3.7/site-packages (from pytest==5.3.5) (19.3.0)
Requirement already satisfied: packaging in /data1/miniconda3/lib/python3.7/site-packages (from pytest==5.3.5) (19.0)
Requirement already satisfied: pluggy<1.0,>=0.12 in /data1/miniconda3/lib/python3.7/site-packages (from pytest==5.3.5) (0.12.0)
Requirement already satisfied: more-itertools>=4.0.0 in /data1/miniconda3/lib/python3.7/site-packages (from pytest==5.3.5) (7.0.0)
Requirement already satisfied: zipp>=0.5 in /data1/miniconda3/lib/python3.7/site-packages (from importlib-metadata>=0.12; python_version < "3.8"->pytest==5.3.5) (0.5.1)
Requirement already satisfied: pyparsing>=2.0.2 in /data1/miniconda3/lib/python3.7/site-packages (from packaging->pytest==5.3.5) (2.4.0)
Requirement already satisfied: six in /data1/miniconda3/lib/python3.7/site-packages (from packaging->pytest==5.3.5) (1.14.0)
Installing collected packages: pytest
Attempting uninstall: pytest
Found existing installation: pytest 5.4.1
Uninstalling pytest-5.4.1:
Successfully uninstalled pytest-5.4.1
Successfully installed pytest-5.3.5
$
$ pytest
Test session starts (platform: linux, Python 3.7.6, pytest 5.3.5, pytest-sugar 0.9.2)
sensitiveurl: .

rootdir: /data1/backend, inifile: pytest.ini
plugins: hypothesis-5.5.1, base-url-1.4.1, variables-1.9.0, selenium-1.17.0, sugar-0.9.2, forked-1.1.3, html-2.1.0, xdist-1.31.0, metadata-1.8.0
gw0 [3] / gw1 [3] / gw2 [3]

tests/test_replication.py ✓✓✓ 100% ██████████

Results (3.29s):
3 passed

@bluetech
Copy link
Member

This should be fixed in pytest-sugar. There is a pending PR for that here: Teemu/pytest-sugar#188.

I suggest subscribing to that PR, and pinning to pytest < 5.4.0 until it is released.

@amitverma12
Copy link
Author

Thank you @bluetech

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants