-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HandlerScheduler throws NPE on schedule() in tests #567
Comments
What version of Android are you running the test on? |
I am running unit tests on JVM, Android Studio 3.6.2 |
You cannot use RxAndroid in JVM tests because it relies on Android APIs.
which will make it have this behavior. Try using Robolectric or running your tests through instrumentation on an actual emulator or device. If you still believe it to be a problem with this library then we'll need an executable test case or sample that demonstrates the failure because as far as I can tell this is impossible behavior in normal usage. |
I am using returnDefaultValues, actually seems that migrating to gradle plugin 3.6.3 solved it. The tests started passing as before. So I think the issue was with the unitTests.returnDefaultValues part most likely |
Experiencing NPE when running tests in a batch. When running tests in one class or one by one they pass. They used to pass it a batch too a couple of days ago. The only dependency that changed is Gradle plugin upgrade to 3.6.
RXJava version 2.1.1
Sample test:
The test() subscription triggers HandlerScheduler schedule() and it hits NPE in line 81. (message.obj = this;)
here is the complete log
I am also replacing all my schedulers with a test rule like so
The text was updated successfully, but these errors were encountered: