Skip to content

Comments

Abstract TimeManager to create reusable resettable variable#19113

Closed
Arthur-Milchior wants to merge 1 commit intoankidroid:mainfrom
Arthur-Milchior:time_test
Closed

Abstract TimeManager to create reusable resettable variable#19113
Arthur-Milchior wants to merge 1 commit intoankidroid:mainfrom
Arthur-Milchior:time_test

Conversation

@Arthur-Milchior
Copy link
Member

Other values than TimeManager may need to be set in test and reset otherwise. In particular it could be useful for #18856.

I tried to abtsract this class. As the stack always had a single value, I removed it.

I don't expect that defining a child class will be useful all the time. But in this case, introducing time avoid changing many many files and keep the code more readble.

Other values than TimeManager may need to be set in test and reset
otherwise. In particular it could be useful for ankidroid#18856.

I tried to abtsract this class. As the stack always had a single
value, I removed it.

I don't expect that defining a child class will be useful all the
time. But in this case, introducing `time` avoid changing many many
files and keep the code more readble.
Copy link
Member

@david-allison david-allison left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Build fails


This feels over-engineered and unintuitive: MockK would be better in most cases

If this pattern is needed again, repeat it before abstracting it into a wrapper.

In addition: it's unusual to have test only code in a non-test context

@david-allison david-allison added the Needs Author Reply Waiting for a reply from the original author label Aug 21, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Sep 8, 2025

Hello 👋, this PR has had no activity for more than 2 weeks and needs a reply from the author. If you think this is a mistake please comment and ping a maintainer to get this merged ASAP! Thanks for contributing! You have 7 days until this gets closed automatically

@github-actions github-actions bot added the Stale label Sep 8, 2025
@github-actions github-actions bot closed this Sep 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Needs Author Reply Waiting for a reply from the original author Stale

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants