Skip to content

✅ Fix broken sdl2 mixer test #2987

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

Merged
merged 1 commit into from
Mar 7, 2024

Conversation

AndreMiras
Copy link
Member

Reproduce with:

PYTHONPATH=. pytest tests/recipes/test_sdl2_mixer.py

The error was:

=================================== FAILURES ===================================
__________________ TestSDL2MixerRecipe.test_get_include_dirs ___________________
self = <test_sdl2_mixer.TestSDL2MixerRecipe testMethod=test_get_include_dirs>
    def test_get_include_dirs(self):
>       list_of_includes = self.recipe.get_include_dirs(self.arch)
tests/recipes/test_sdl2_mixer.py:12:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pythonforandroid/recipes/sdl2_mixer/__init__.py:13: in get_include_dirs
    os.path.join(self.ctx.bootstrap.build_dir, "jni", "SDL2_mixer", "include")
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
a = None, p = ('jni', 'SDL2_mixer', 'include')
>   ???
E   TypeError: expected str, bytes or os.PathLike object, not NoneType
<frozen posixpath>:76: TypeError

Also do some minor code clean up and absolute import path fixes.

Reproduce with:
```
PYTHONPATH=. pytest tests/recipes/test_sdl2_mixer.py
```
The error was:
```
=================================== FAILURES ===================================
__________________ TestSDL2MixerRecipe.test_get_include_dirs ___________________
self = <test_sdl2_mixer.TestSDL2MixerRecipe testMethod=test_get_include_dirs>
    def test_get_include_dirs(self):
>       list_of_includes = self.recipe.get_include_dirs(self.arch)
tests/recipes/test_sdl2_mixer.py:12:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pythonforandroid/recipes/sdl2_mixer/__init__.py:13: in get_include_dirs
    os.path.join(self.ctx.bootstrap.build_dir, "jni", "SDL2_mixer", "include")
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
a = None, p = ('jni', 'SDL2_mixer', 'include')
>   ???
E   TypeError: expected str, bytes or os.PathLike object, not NoneType
<frozen posixpath>:76: TypeError
```

Also do some minor code clean up and absolute import path fixes.
@AndreMiras AndreMiras merged commit 8eacdc0 into kivy:develop Mar 7, 2024
@AndreMiras AndreMiras deleted the feature/test_sdl2_mixer branch March 7, 2024 20:57
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.

1 participant