PY-24010: Set module explicitly from context before getTargetForConfig

To prevent cases like PY-24302 and PY-24010 we should set module
from context.

After module renaming or in case of two modules configuration.module
is wrong. Hence we set it from context.
This commit is contained in:
Ilya.Kazakevich
2017-06-10 01:31:04 +03:00
parent 9ad89facc6
commit 3fead94c23
@@ -625,6 +625,7 @@ object PyTestsConfigurationProducer : com.jetbrains.python.testing.AbstractPytho
}
val location = context?.location
configuration.module = context?.module
if (location is com.jetbrains.python.testing.PyTargetBasedPsiLocation) {
location.target.copyTo(configuration.target)
}
@@ -637,7 +638,6 @@ object PyTestsConfigurationProducer : com.jetbrains.python.testing.AbstractPytho
configuration.workingDirectory = targetForConfig.second
}
}
configuration.module = context?.module
configuration.setGeneratedName()
return true
}