Skip to content

Commit 28365d9

Browse files
committed
test: skip status check in unit tests
1 parent 6432b76 commit 28365d9

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

marker/src/main/kotlin/spp/jetbrains/marker/SourceMarker.kt

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ package spp.jetbrains.marker
1919
import com.google.common.collect.ImmutableList
2020
import com.google.common.collect.Lists
2121
import com.google.common.collect.Maps
22+
import com.intellij.openapi.application.ApplicationManager
2223
import com.intellij.openapi.diagnostic.logger
2324
import com.intellij.openapi.project.Project
2425
import com.intellij.openapi.util.Key
@@ -103,9 +104,11 @@ class SourceMarker(private val project: Project) {
103104
} else if (psiFile.virtualFile == null || !psiFile.virtualFile.isInLocalFileSystem) {
104105
log.warn("Skipping in-memory/non-local file: $psiFile")
105106
return null
106-
} else if (!SourceStatusService.getInstance(project).isConnected()) {
107-
log.warn("Not connected, skipping source file marker creation for: $psiFile")
108-
return null
107+
} else if (!ApplicationManager.getApplication().isUnitTestMode) {
108+
if (!SourceStatusService.getInstance(project).isConnected()) {
109+
log.warn("Not connected, skipping source file marker creation for: $psiFile")
110+
return null
111+
}
109112
}
110113

111114
fileMarker = configuration.sourceFileMarkerProvider.createSourceFileMarker(psiFile)

0 commit comments

Comments
 (0)