tarpas / pytest-testmon

Selects tests affected by changed files. Executes the right tests first. Continuous test runner when used with pytest-watch.
https://testmon.org
MIT License
823 stars 55 forks source link

Fails with pytest 4 #117

Closed max-sixty closed 5 years ago

max-sixty commented 5 years ago

Unfortunately testmon seems to raise even when it's not being used?

Traceback (most recent call last):
File "/usr/local/bin/pytest", line 11, in <module>
sys.exit(main())
File "/usr/local/lib/python2.7/dist-packages/_pytest/config/__init__.py", line 58, in main
config = _prepareconfig(args, plugins)
File "/usr/local/lib/python2.7/dist-packages/_pytest/config/__init__.py", line 196, in _prepareconfig
pluginmanager=pluginmanager, args=args
File "/usr/local/lib/python2.7/dist-packages/pluggy/hooks.py", line 284, in __call__
return self._hookexec(self, self.get_hookimpls(), kwargs)
File "/usr/local/lib/python2.7/dist-packages/pluggy/manager.py", line 67, in _hookexec
return self._inner_hookexec(hook, methods, kwargs)
File "/usr/local/lib/python2.7/dist-packages/pluggy/manager.py", line 61, in <lambda>
firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
File "/usr/local/lib/python2.7/dist-packages/pluggy/callers.py", line 203, in _multicall
gen.send(outcome)
File "/usr/local/lib/python2.7/dist-packages/_pytest/helpconfig.py", line 93, in pytest_cmdline_parse
config = outcome.get_result()
File "/usr/local/lib/python2.7/dist-packages/pluggy/callers.py", line 81, in get_result
_reraise(*ex) # noqa
File "/usr/local/lib/python2.7/dist-packages/pluggy/callers.py", line 187, in _multicall
res = hook_impl.function(*args)
File "/usr/local/lib/python2.7/dist-packages/_pytest/config/__init__.py", line 675, in pytest_cmdline_parse
self.parse(args)
File "/usr/local/lib/python2.7/dist-packages/_pytest/config/__init__.py", line 845, in parse
self._preparse(args, addopts=addopts)
File "/usr/local/lib/python2.7/dist-packages/_pytest/config/__init__.py", line 799, in _preparse
self.pluginmanager.load_setuptools_entrypoints("pytest11")
File "/usr/local/lib/python2.7/dist-packages/pluggy/manager.py", line 273, in load_setuptools_entrypoints
message="Plugin %r could not be loaded: %s!" % (ep.name, e),
pluggy.manager.PluginValidationError: Plugin 'testmon' could not be loaded: (pytest 4.0.0 (/usr/local/lib/python2.7/dist-packages), Requirement.parse('pytest<4,>=2.8.0'))!
blueyed commented 5 years ago
  1. I assume the requirement could be lifted.

  2. But normally you should not be able to install pytest 4 and pytest-testmon in the first place due to the version requirement. Have you forcefully installed it? If not, what version of pip are you using?

blueyed commented 5 years ago

I assume it does not throw with -p no:testmon?

In general there is not much that can be done here likely, since testmon uses pytest_cmdline_parse to see if it should be used / is active, and pytest checks the version/compat before already here.

max-sixty commented 5 years ago

But normally you should not be able to install pytest 4 and pytest-testmon in the first place due to the version requirement. Have you forcefully installed it? If not, what version of pip are you using?

I didn't forcefully install & it's using current pip (I built the image today); but in my experience pip is not reliable at enforcing these dependencies when given a requirements.txt file...

webknjaz commented 5 years ago

Hey @Matlino @blueyed could somebody release this to PyPI please?

webknjaz commented 5 years ago

(having the same failure: https://travis-ci.org/cherrypy/cheroot/jobs/459524030#L541)

webknjaz commented 5 years ago

Thanks!