AngellusMortis / django_microsoft_auth

Simple app to enable Microsoft Account, Office 365 and Xbox Live authentcation as a Django authentcation backend.
MIT License
137 stars 84 forks source link

`tests/test_apps.py` Tests Fail On MacOS #488

Open korverdev opened 1 year ago

korverdev commented 1 year ago

After following the setup instructions in CONTRIBUTING.rst, I'm running into errors for all tests in test_apps.py.

Environment Information: MacBook Pro 14-inch 2021 Chip: Apple M1 Pro MacOS: Ventura 13.0.1

Output:

╭──────────────────────────────────────── pytest session starts ────────────────────────────────────────╮
│ platform darwin pytest 7.1.3 python 3.11.0                                                            │
│ root /Users/casey/Desktop/personal_projects/django_microsoft_auth                                     │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────╯
Collected 125 items
⠸ [100%] tests/test_admin.py ✔✔✔                                 
⠸ [ 38%] tests/test_apps.py ❌❌❌❌❌                           
⠸ [100%] tests/test_client.py ✔✔✔✔✔✔✔✔✔✔✔✔✔✔✔✔✔✔✔✔               
⠸ [100%] tests/test_context_processors.py ✔✔✔✔✔✔✔                
⠸ [100%] tests/test_models.py ✔✔✔                                
⠸ [100%] tests/test_utils.py ✔✔✔✔✔✔✔✔                            
⠸ [100%] tests/test_views.py ✔✔✔✔✔✔✔✔✔✔✔✔✔✔✔                     
⠸ [  8%] tests/test_zconstance.py ✔✔                             
⠸ [100%] tests/test_backends/test_microsoft.py ✔✔✔✔✔✔✔✔✔✔✔✔✔✔✔✔✔✔
⠸ [100%] tests/test_backends/test_xbox.py ✔✔✔✔✔✔✔✔               
⠸ Percent: 71%                                                   
─────────────────────────────────────────────── FAILURES ────────────────────────────────────────────────
Traceback (most recent call last):
  File "/Users/casey/.pyenv/versions/django_microsoft_auth/bin/py.test", line 8, in <module>
    sys.exit(console_main())
             ^^^^^^^^^^^^^^
  File "/Users/casey/.pyenv/versions/3.11.0/envs/django_microsoft_auth/lib/python3.11/site-packages/_pytest/config/__init__.py", line 187, in console_main
    code = main()
           ^^^^^^
  File "/Users/casey/.pyenv/versions/3.11.0/envs/django_microsoft_auth/lib/python3.11/site-packages/_pytest/config/__init__.py", line 164, in main
    ret: Union[ExitCode, int] = config.hook.pytest_cmdline_main(
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/casey/.pyenv/versions/3.11.0/envs/django_microsoft_auth/lib/python3.11/site-packages/pluggy/_hooks.py", line 265, in __call__
    return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/casey/.pyenv/versions/3.11.0/envs/django_microsoft_auth/lib/python3.11/site-packages/pluggy/_manager.py", line 80, in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/casey/.pyenv/versions/3.11.0/envs/django_microsoft_auth/lib/python3.11/site-packages/pluggy/_callers.py", line 60, in _multicall
    return outcome.get_result()
           ^^^^^^^^^^^^^^^^^^^^
  File "/Users/casey/.pyenv/versions/3.11.0/envs/django_microsoft_auth/lib/python3.11/site-packages/pluggy/_result.py", line 60, in get_result
    raise ex[1].with_traceback(ex[2])
  File "/Users/casey/.pyenv/versions/3.11.0/envs/django_microsoft_auth/lib/python3.11/site-packages/pluggy/_callers.py", line 39, in _multicall
    res = hook_impl.function(*args)
          ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/casey/.pyenv/versions/3.11.0/envs/django_microsoft_auth/lib/python3.11/site-packages/_pytest/main.py", line 315, in pytest_cmdline_main
    return wrap_session(config, _main)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/casey/.pyenv/versions/3.11.0/envs/django_microsoft_auth/lib/python3.11/site-packages/_pytest/main.py", line 303, in wrap_session
    config.hook.pytest_sessionfinish(
  File "/Users/casey/.pyenv/versions/3.11.0/envs/django_microsoft_auth/lib/python3.11/site-packages/pluggy/_hooks.py", line 265, in __call__
    return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/casey/.pyenv/versions/3.11.0/envs/django_microsoft_auth/lib/python3.11/site-packages/pluggy/_manager.py", line 80, in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/casey/.pyenv/versions/3.11.0/envs/django_microsoft_auth/lib/python3.11/site-packages/pluggy/_callers.py", line 60, in _multicall
    return outcome.get_result()
           ^^^^^^^^^^^^^^^^^^^^
  File "/Users/casey/.pyenv/versions/3.11.0/envs/django_microsoft_auth/lib/python3.11/site-packages/pluggy/_result.py", line 60, in get_result
    raise ex[1].with_traceback(ex[2])
  File "/Users/casey/.pyenv/versions/3.11.0/envs/django_microsoft_auth/lib/python3.11/site-packages/pluggy/_callers.py", line 39, in _multicall
    res = hook_impl.function(*args)
          ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/casey/.pyenv/versions/3.11.0/envs/django_microsoft_auth/lib/python3.11/site-packages/pytest_rich.py", line 246, in pytest_sessionfinish
    self.console.print(tb)
  File "/Users/casey/.pyenv/versions/3.11.0/envs/django_microsoft_auth/lib/python3.11/site-packages/rich/console.py", line 1673, in print
    extend(render(renderable, render_options))
  File "/Users/casey/.pyenv/versions/3.11.0/envs/django_microsoft_auth/lib/python3.11/site-packages/rich/console.py", line 1305, in render
    for render_output in iter_render:
  File "/Users/casey/.pyenv/versions/3.11.0/envs/django_microsoft_auth/lib/python3.11/site-packages/pytest_rich.py", line 306, in __rich_console__
    self._render_chain(self.chain, options),
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/casey/.pyenv/versions/3.11.0/envs/django_microsoft_auth/lib/python3.11/site-packages/rich/console.py", line 504, in _replace
    return Group(*renderables, fit=fit)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/casey/.pyenv/versions/3.11.0/envs/django_microsoft_auth/lib/python3.11/site-packages/pytest_rich.py", line 426, in _render_chain
    args = get_args(entry.reprfuncargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/casey/.pyenv/versions/3.11.0/envs/django_microsoft_auth/lib/python3.11/site-packages/pytest_rich.py", line 386, in get_args
    for arg in reprfuncargs.args:
               ^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'args'