Skip to content
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

Pytest assertion rewriting doesn't work in Android testbed #1961

Closed
mhsmith opened this issue Jun 5, 2023 · 0 comments
Closed

Pytest assertion rewriting doesn't work in Android testbed #1961

mhsmith opened this issue Jun 5, 2023 · 0 comments
Labels
android The issue relates to Android mobile support. bug A crash or error in behavior.

Comments

@mhsmith
Copy link
Member

mhsmith commented Jun 5, 2023

For example, if a test contains the following code:

    a = 1
    b = 2
    assert a == b

macOS outputs this:

    assert a == b
AssertionError: assert 1 == 2

But Android doesn't show the values:

I/python.stdout:     assert a == b
I/python.stdout: AssertionError

This is probably caused by some conflict between the Chaquopy importer and the Pytest assertion rewriting mechanism, which as I understand it, involves actually generating its own .pyc files with the modified bytecode.

In practice, it's usually easy to work around this with some extra logging or an explicit assert message, so it's not worth looking into just now.

@mhsmith mhsmith added bug A crash or error in behavior. android The issue relates to Android mobile support. labels Jun 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
android The issue relates to Android mobile support. bug A crash or error in behavior.
Projects
None yet
Development

No branches or pull requests

1 participant