Skip to content

Conversation

little-dude
Copy link
Contributor

tests are failing due to a fixture being deprecated in pytest. For instance: https://travis-ci.org/docker/docker-py/jobs/458206472

_________________ FindConfigFileTest.test_find_config_fallback _________________
tests/unit/utils_config_test.py:24: in test_find_config_fallback
    tmpdir = self.tmpdir('test_find_config_fallback')
tests/unit/utils_config_test.py:19: in tmpdir
    tmpdir = ensuretemp(name)
.tox/py27/lib/python2.7/site-packages/_pytest/tmpdir.py:96: in ensuretemp
    warnings.warn(PYTEST_ENSURETEMP, stacklevel=2)
E   RemovedInPytest4Warning: pytest/tmpdir_factory.ensuretemp is deprecated, 
E   please use the tmp_path fixture or tmp_path_factory.mktemp

@GordonTheTurtle
Copy link

Please sign your commits following these rules:
https://github.com/moby/moby/blob/master/CONTRIBUTING.md#sign-your-work
The easiest way to do this is to amend the last commit:

$ git clone -b "fix_deprecation" git@github.com:little-dude/docker-py.git somewhere
$ cd somewhere
$ git commit --amend -s --no-edit
$ git push -f

Amending updates the existing PR. You DO NOT need to open a new one.

Signed-off-by: Corentin Henry <corentinhenry@gmail.com>
@little-dude
Copy link
Contributor Author

Not sure why Jenkins is failing. Is it because of those INTERNALERROR?

@little-dude
Copy link
Contributor Author

Ah yeah. Looks like it. The last green job tells us which tests trigger the error:

19:56:27 [py2.7_17.06.2-ce] tests/integration/api_container_test.py::LogsTest::test_logs_streaming_and_follow_and_cancel
19:56:27 [py2.7_17.06.2-ce]   /usr/local/lib/python2.7/site-packages/pytest_timeout.py:178: RemovedInPytest4Warning: MarkInfo objects are deprecated as they contain merged marks which are hard to deal with correctly.
19:56:27 [py2.7_17.06.2-ce]   Please use node.get_closest_marker(name) or node.iter_markers(name).
19:56:27 [py2.7_17.06.2-ce]   Docs: https://docs.pytest.org/en/latest/mark.html#updating-code

@little-dude
Copy link
Contributor Author

Seems that it's due to pytest-timeout:

    @pytest.mark.timeout(5)
    @pytest.mark.skipif(os.environ.get('DOCKER_HOST', '').startswith('ssh://'),
                        reason='No cancellable streams over SSH')
    def test_attach_stream_and_cancel(self):
        # ...

Signed-off-by: Corentin Henry <corentinhenry@gmail.com>

pytest-timeout 1.2.1 seems to be incompatible with pytest 3.6.3:

INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/usr/local/lib/python2.7/site-packages/_pytest/main.py", line 185, in wrap_session
INTERNALERROR>     session.exitstatus = doit(config, session) or 0
INTERNALERROR>   File "/usr/local/lib/python2.7/site-packages/_pytest/main.py", line 225, in _main
INTERNALERROR>     config.hook.pytest_runtestloop(session=session)
INTERNALERROR>   File "/usr/local/lib/python2.7/site-packages/pluggy/hooks.py", line 284, in __call__
INTERNALERROR>     return self._hookexec(self, self.get_hookimpls(), kwargs)
INTERNALERROR>   File "/usr/local/lib/python2.7/site-packages/pluggy/manager.py", line 67, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR>   File "/usr/local/lib/python2.7/site-packages/pluggy/manager.py", line 61, in <lambda>
INTERNALERROR>     firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
INTERNALERROR>   File "/usr/local/lib/python2.7/site-packages/pluggy/callers.py", line 208, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "/usr/local/lib/python2.7/site-packages/pluggy/callers.py", line 81, in get_result
INTERNALERROR>     _reraise(*ex)  # noqa
INTERNALERROR>   File "/usr/local/lib/python2.7/site-packages/pluggy/callers.py", line 187, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "/usr/local/lib/python2.7/site-packages/_pytest/main.py", line 246, in pytest_runtestloop
INTERNALERROR>     item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem)
INTERNALERROR>   File "/usr/local/lib/python2.7/site-packages/pluggy/hooks.py", line 284, in __call__
INTERNALERROR>     return self._hookexec(self, self.get_hookimpls(), kwargs)
INTERNALERROR>   File "/usr/local/lib/python2.7/site-packages/pluggy/manager.py", line 67, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR>   File "/usr/local/lib/python2.7/site-packages/pluggy/manager.py", line 61, in <lambda>
INTERNALERROR>     firstresult=hook.spec.opts.get("firstresult") if hook.spec else False,
INTERNALERROR>   File "/usr/local/lib/python2.7/site-packages/pluggy/callers.py", line 208, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "/usr/local/lib/python2.7/site-packages/pluggy/callers.py", line 81, in get_result
INTERNALERROR>     _reraise(*ex)  # noqa
INTERNALERROR>   File "/usr/local/lib/python2.7/site-packages/pluggy/callers.py", line 182, in _multicall
INTERNALERROR>     next(gen)  # first yield
INTERNALERROR>   File "/usr/local/lib/python2.7/site-packages/pytest_timeout.py", line 76, in pytest_runtest_protocol
INTERNALERROR>     timeout_setup(item)
INTERNALERROR>   File "/usr/local/lib/python2.7/site-packages/pytest_timeout.py", line 104, in timeout_setup
INTERNALERROR>     timeout, method = get_params(item)
INTERNALERROR>   File "/usr/local/lib/python2.7/site-packages/pytest_timeout.py", line 162, in get_params
INTERNALERROR>     timeout, method = _parse_marker(item.keywords['timeout'])
INTERNALERROR>   File "/usr/local/lib/python2.7/site-packages/pytest_timeout.py", line 178, in _parse_marker
INTERNALERROR>     if not marker.args and not marker.kwargs:
INTERNALERROR>   File "/usr/local/lib/python2.7/site-packages/_pytest/mark/structures.py", line 25, in warned
INTERNALERROR>     warnings.warn(warning, stacklevel=2)
INTERNALERROR> RemovedInPytest4Warning: MarkInfo objects are deprecated as they contain merged marks which are hard to deal with correctly.
INTERNALERROR> Please use node.get_closest_marker(name) or node.iter_markers(name).
INTERNALERROR> Docs: https://docs.pytest.org/en/latest/mark.html#updating-code
@little-dude
Copy link
Contributor Author

Seems like bumping pytest-timeout does the trick. Tests should be passing now.

@shin-
Copy link
Contributor

shin- commented Nov 27, 2018

Thanks!

@shin- shin- added this to the 3.6.0 milestone Nov 27, 2018
@shin- shin- merged commit f3231a1 into docker:master Nov 27, 2018
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

Successfully merging this pull request may close these issues.

3 participants