#8220 Pylint for python2 complains about import from ipaplatform
Closed: fixed by frenaud. Opened by sorlov.

When making a backport for ipa-4-6 (https://github.com/freeipa/freeipa/pull/4327) I faced pylint error no-name-in-module: https://travis-ci.org/freeipa/freeipa/jobs/660213287?utm_medium=notification&utm_source=github_status

************* Module ipatests.test_integration.test_sudo
ipatests/test_integration/test_sudo.py:22: [E0611(no-name-in-module), ] No name 'paths' in module 'ipatests.test_integration.ipaplatform.paths')
ipatests/test_integration/test_sudo.py:22: [W0403(relative-import), ] Relative import 'ipaplatform.paths', should be 'ipatests.test_integration.ipaplatform.paths')

The mentioned line reads:

from ipaplatform.paths import paths

The problem is presumably is caused by some recent changes to pylint config as there are numerous occurrences of exactly same same line throughout the tests code.


Adding from __future__ import absolute_import usually fixes the problem.

ipa-4-6:

  • 044748b5724f408643fe9f95c3a63d29ca646002 ipatests: temporary disable pylint check no-name-in-module

@cheimes
Unfortunately I pushed the workaround before noticing your comment.
I opened https://github.com/freeipa/freeipa/pull/4332 to remove the workaround.

ipa-4-6:

  • 46b9139ac9ecbbd89495239e380982514db3a5f4 ipatests: remove workaround for pylint error no-name-in-module

Metadata Update from @frenaud:
- Issue close_status updated to: fixed
- Issue status updated to: Closed (was: Open)

Metadata