Skip to content

pytest is not running when i run it through tox -- Mac #2777

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

Closed
rsmamidi opened this issue Sep 13, 2017 · 11 comments
Closed

pytest is not running when i run it through tox -- Mac #2777

rsmamidi opened this issue Sep 13, 2017 · 11 comments
Labels
status: needs information reporter needs to provide more information; can be closed after 2 or more weeks of inactivity type: question general question, might be closed after 2 weeks of inactivity

Comments

@rsmamidi
Copy link

rsmamidi commented Sep 13, 2017

Rups-MacBook-Pro:securehomegateway-automation rupsankar$ tox -- -x tests/mobile --app apps/SecureHomePlatform.app --platform ios -m debug
py27 installed: Appium-Python-Client==0.22,certifi==2017.7.27.1,chardet==3.0.4,Django==1.11.5,dnspython==1.15.0,enum34==1.1.6,idna==2.6,image==1.5.15,lxml==3.8.0,namedlist==1.7,olefile==0.44,pexpect==4.2.1,Pillow==4.2.1,ptyprocess==0.5.2,py==1.4.34,pytest==2.8.7,pytest-allure-adaptor==1.7.5,pytest-html==1.15.2,pytest-metadata==1.5.0,pytest-ordering==0.5,pytest-repeat==0.4.1,pytest-sugar==0.9.0,pytz==2017.2,requests==2.18.4,selenium==3.5.0,six==1.10.0,termcolor==1.1.0,urllib3==1.22,xlrd==1.1.0,xlutils==2.0.0,xlwt==1.3.0
py27 runtests: PYTHONHASHSEED='4221407607'
py27 runtests: commands[0] | py.test -x tests/mobile --app apps/SecureHomePlatform.app --platform ios -m debug
Traceback (most recent call last):
  File ".tox/py27/bin/py.test", line 11, in <module>
    sys.exit(main())
  File "/Users/rupsankar/Documents/Mobile/securehomegateway-automation/.tox/py27/lib/python2.7/site-packages/_pytest/config.py", line 38, in main
    config = _prepareconfig(args, plugins)
  File "/Users/rupsankar/Documents/Mobile/securehomegateway-automation/.tox/py27/lib/python2.7/site-packages/_pytest/config.py", line 117, in _prepareconfig
    pluginmanager=pluginmanager, args=args)
  File "/Users/rupsankar/Documents/Mobile/securehomegateway-automation/.tox/py27/lib/python2.7/site-packages/_pytest/vendored_packages/pluggy.py", line 724, in __call__
    return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
  File "/Users/rupsankar/Documents/Mobile/securehomegateway-automation/.tox/py27/lib/python2.7/site-packages/_pytest/vendored_packages/pluggy.py", line 338, in _hookexec
    return self._inner_hookexec(hook, methods, kwargs)
  File "/Users/rupsankar/Documents/Mobile/securehomegateway-automation/.tox/py27/lib/python2.7/site-packages/_pytest/vendored_packages/pluggy.py", line 333, in <lambda>
    _MultiCall(methods, kwargs, hook.spec_opts).execute()
  File "/Users/rupsankar/Documents/Mobile/securehomegateway-automation/.tox/py27/lib/python2.7/site-packages/_pytest/vendored_packages/pluggy.py", line 595, in execute
    return _wrapped_call(hook_impl.function(*args), self.execute)
  File "/Users/rupsankar/Documents/Mobile/securehomegateway-automation/.tox/py27/lib/python2.7/site-packages/_pytest/vendored_packages/pluggy.py", line 249, in _wrapped_call
    wrap_controller.send(call_outcome)
  File "/Users/rupsankar/Documents/Mobile/securehomegateway-automation/.tox/py27/lib/python2.7/site-packages/_pytest/helpconfig.py", line 28, in pytest_cmdline_parse
    config = outcome.get_result()
  File "/Users/rupsankar/Documents/Mobile/securehomegateway-automation/.tox/py27/lib/python2.7/site-packages/_pytest/vendored_packages/pluggy.py", line 279, in get_result
    _reraise(*ex)  # noqa
  File "/Users/rupsankar/Documents/Mobile/securehomegateway-automation/.tox/py27/lib/python2.7/site-packages/_pytest/vendored_packages/pluggy.py", line 264, in __init__
    self.result = func()
  File "/Users/rupsankar/Documents/Mobile/securehomegateway-automation/.tox/py27/lib/python2.7/site-packages/_pytest/vendored_packages/pluggy.py", line 596, in execute
    res = hook_impl.function(*args)
  File "/Users/rupsankar/Documents/Mobile/securehomegateway-automation/.tox/py27/lib/python2.7/site-packages/_pytest/config.py", line 852, in pytest_cmdline_parse
    self.parse(args)
  File "/Users/rupsankar/Documents/Mobile/securehomegateway-automation/.tox/py27/lib/python2.7/site-packages/_pytest/config.py", line 957, in parse
    self._preparse(args)
  File "/Users/rupsankar/Documents/Mobile/securehomegateway-automation/.tox/py27/lib/python2.7/site-packages/_pytest/config.py", line 918, in _preparse
    self.pluginmanager.load_setuptools_entrypoints("pytest11")
  File "/Users/rupsankar/Documents/Mobile/securehomegateway-automation/.tox/py27/lib/python2.7/site-packages/_pytest/vendored_packages/pluggy.py", line 501, in load_setuptools_entrypoints
    plugin = ep.load()
  File "/Users/rupsankar/Documents/Mobile/securehomegateway-automation/.tox/py27/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2340, in load
    self.require(*args, **kwargs)
  File "/Users/rupsankar/Documents/Mobile/securehomegateway-automation/.tox/py27/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2363, in require
    items = working_set.resolve(reqs, env, installer, extras=self.extras)
  File "/Users/rupsankar/Documents/Mobile/securehomegateway-automation/.tox/py27/lib/python2.7/site-packages/pkg_resources/__init__.py", line 872, in resolve
    raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.VersionConflict: (pytest 2.8.7 (/Users/rupsankar/Documents/Mobile/securehomegateway-automation/.tox/py27/lib/python2.7/site-packages), Requirement.parse('pytest>=2.9'))
ERROR: InvocationError: '/Users/rupsankar/Documents/Mobile/securehomegateway-automation/.tox/py27/bin/py.test -x tests/mobile --app apps/SecureHomePlatform.app --platform ios -m debug'
_______________________________________________________________________________ summary _______________________________________________________________________________
ERROR:   py27: commands failed

Need help to solve this error

@nicoddemus
Copy link
Member

The gist is:

pkg_resources.VersionConflict: (pytest 2.8.7 (/Users/rupsankar/Documents/Mobile/securehomegateway-automation/.tox/py27/lib/python2.7/site-packages), Requirement.parse('pytest>=2.9'))

Something is requiring pytest >=2.9, but something is installing 2.8.7. Can you post your tox file?

@nicoddemus nicoddemus added status: needs information reporter needs to provide more information; can be closed after 2 or more weeks of inactivity type: question general question, might be closed after 2 weeks of inactivity labels Sep 13, 2017
@rsmamidi
Copy link
Author

[tox]
skipsdist = True
envlist = py27

[testenv]
whitelist_externals = adb

deps = pytest==2.8.7
selenium
requests
pytest-html
pytest-sugar
Appium-Python-Client==0.22
dnspython
pexpect
xlwt
xlrd
xlutils
pytest-ordering
pytest-repeat
pytz
image
pytest-allure-adaptor==1.7.5

commands = py.test {posargs}

[pytest]
addopts = --junitxml=logs/results.xml
--html=logs/report.html

@RonnyPfannschmidt
Copy link
Member

this looks like a clear user error, you pinned pytest==2.8.7 and one of your dependencies needs pytest >=2.9

@rsmamidi
Copy link
Author

rsmamidi commented Sep 14, 2017

@RonnyPfannschmidt How can get to know what dependence need pytest update, and i don't want to change the pytest version . it will disturb my android setup

i had Automation suit on appium -python / pytest for android now i want to use the same scripts for ios as well .

@RonnyPfannschmidt
Copy link
Member

likely pytest-html or one of the other pytest plugins, they dropped support for rather old pytest versions in their recent versions

@rsmamidi
Copy link
Author

@RonnyPfannschmidt i need your help for configuring pytest in mac for doing IOS - appium automation , it will be good help if you can tell the list of dependency and their versions.

any usefull links also please share.

@RonnyPfannschmidt
Copy link
Member

@rsmamidi i cant help with that, i dont own a mac and have no idea about appium automation

@obestwalter
Copy link
Member

obestwalter commented Sep 14, 2017

@rsmamidi a quick suggestion how you could find that out on your own:

Remove all deps in your tox.ini except for pytest==2.8.7 then start readding the other deps, one by one and always run tox in between. At some time it will crash and you knwo which package causes the problem.

@The-Compiler
Copy link
Member

Why do you need to keep using an old version of pytest though? There have been a lot of fixes since 2.8.7.

@rsmamidi
Copy link
Author

guys i solve the issues in mac now... @obestwalter your suggestion help me to fine the dependence issues. previously i use tox to run the test suit now i am running in virtual env to run my suit and works perfectly . Thanks for all the support

@obestwalter
Copy link
Member

Great to hear @rsmamidi :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs information reporter needs to provide more information; can be closed after 2 or more weeks of inactivity type: question general question, might be closed after 2 weeks of inactivity
Projects
None yet
Development

No branches or pull requests

5 participants