void () { // resolve to the first implementation myFixture .copyDirectoryToProject("resolve/OverloadsAndImplementationsInImportedClassDep", "OverloadsAndImplementationsInImportedClassDep"); final PyFunction foo = assertResolvesTo(PyFunction.class, "foo"); final TypeEvalContext context = TypeEvalContext.codeAnalysis(myFixture.getProject(), myFixture.getFile()); assertFalse(PyiUtil.isOverload(foo, context)); final PyClass pyClass = foo.getContainingClass(); assertNotNull(pyClass); pyClass.visitMethods( function -> { assertTrue(PyiUtil.isOverload(function, context) || function == foo || PyPsiUtils.isBefore(foo, function)); return true; }, false, context ); }