Skip to content

Use existing TestScope instead of creating a new one - #560

Closed
veyndan wants to merge 1 commit into
androidx:androidx-mainfrom
veyndan:veyndan/rm-coroutineScope
Closed

veyndan wants to merge 1 commit into
androidx:androidx-mainfrom
veyndan:veyndan/rm-coroutineScope

Conversation

@veyndan

@veyndan veyndan commented Jun 6, 2023

Copy link
Copy Markdown
Contributor

I'm trying to see if I can elegantly remove the dependence of PagingDataDifferTest.kt on MainDispatcherRule, without just inlining the class. Keeping track of all the CoroutineScopes for each test is difficult though, so I'm trying to slightly reduce it here (i.e., use the TestScope that the SimpleDiffer is invoked from, instead of creating a new one).

Test: ./gradlew test connectedCheck

@veyndan

veyndan commented Jun 6, 2023

Copy link
Copy Markdown
Contributor Author

I managed to remove the usage of MainDispatcherRule at #562. This change is no longer required. Personally, I find this change easier to read than what was before, but if you disagree, feel free to just close this PR.

@dlam
dlam requested a review from claraf3 June 6, 2023 19:27
@claraf3

claraf3 commented Jun 6, 2023

Copy link
Copy Markdown
Member

Thanks for the clean up!

@veyndan
veyndan force-pushed the veyndan/rm-coroutineScope branch from d7a8fcd to cab9e06 Compare June 12, 2023 12:31
@veyndan
veyndan deleted the veyndan/rm-coroutineScope branch June 18, 2023 19:37
harryzz pushed a commit to harryzz/compose-multiplatform-core that referenced this pull request Jul 28, 2026
I'm trying to see if I can elegantly remove the dependence of `PagingDataDifferTest.kt` on `MainDispatcherRule`, without just inlining the class. Keeping track of all the `CoroutineScope`s for each test is difficult though, so I'm trying to slightly reduce it here (i.e., use the `TestScope` that the `SimpleDiffer` is invoked from, instead of creating a new one).

Test: ./gradlew test connectedCheck

This is an imported pull request from androidx#560.

Resolves JetBrains#560
Github-Pr-Head-Sha: cab9e06
GitOrigin-RevId: 8cc3a38
Change-Id: I6b12be16fd3c4a335d9a170224b4a2b917b5dbdd
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.

2 participants