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

[BUG] NameError: name 'ThreadedRunner' is not defined #2045

Closed
vigenere23 opened this issue May 11, 2022 · 3 comments · Fixed by #2046
Closed

[BUG] NameError: name 'ThreadedRunner' is not defined #2045

vigenere23 opened this issue May 11, 2022 · 3 comments · Fixed by #2046

Comments

@vigenere23
Copy link

vigenere23 commented May 11, 2022

Relates to #2036 (https://github.com/plotly/dash/pull/2036/files#diff-103dd9b465768e0bec146c9ea9b04b9e762d9a6e2532c18e3ec4887a987e8d13)

Describe your context

Import error on the new 2.4.0 update when testing my app with pytest?

dash                                            2.4.0     
dash-core-components                            2.0.0     
dash-html-components                            2.0.0     
dash-table                                      5.0.0 

Describe the bug

Traceback (most recent call last):
  File ".venv/bin/pytest", line 8, in <module>
    sys.exit(console_main())
  File ".venv/lib/python3.9/site-packages/_pytest/config/__init__.py", line 185, in console_main
    code = main()
  File ".venv/lib/python3.9/site-packages/_pytest/config/__init__.py", line 143, in main
    config = _prepareconfig(args, plugins)
  File ".venv/lib/python3.9/site-packages/_pytest/config/__init__.py", line 318, in _prepareconfig
    config = pluginmanager.hook.pytest_cmdline_parse(
  File ".venv/lib/python3.9/site-packages/pluggy/_hooks.py", line 265, in __call__
    return self._hookexec(self.name, self.get_hookimpls(), kwargs, firstresult)
  File ".venv/lib/python3.9/site-packages/pluggy/_manager.py", line 80, in _hookexec
    return self._inner_hookexec(hook_name, methods, kwargs, firstresult)
  File ".venv/lib/python3.9/site-packages/pluggy/_callers.py", line 55, in _multicall
    gen.send(outcome)
  File ".venv/lib/python3.9/site-packages/_pytest/helpconfig.py", line 100, in pytest_cmdline_parse
    config: Config = outcome.get_result()
  File ".venv/lib/python3.9/site-packages/pluggy/_result.py", line 60, in get_result
    raise ex[1].with_traceback(ex[2])
  File ".venv/lib/python3.9/site-packages/pluggy/_callers.py", line 39, in _multicall
    res = hook_impl.function(*args)
  File ".venv/lib/python3.9/site-packages/_pytest/config/__init__.py", line 1003, in pytest_cmdline_parse
    self.parse(args)
  File ".venv/lib/python3.9/site-packages/_pytest/config/__init__.py", line 1283, in parse
    self._preparse(args, addopts=addopts)
  File ".venv/lib/python3.9/site-packages/_pytest/config/__init__.py", line 1172, in _preparse
    self.pluginmanager.load_setuptools_entrypoints("pytest11")
  File ".venv/lib/python3.9/site-packages/pluggy/_manager.py", line 287, in load_setuptools_entrypoints
    plugin = ep.load()
  File "/usr/local/lib/python3.9/importlib/metadata.py", line 86, in load
    module = import_module(match.group('module'))
  File "/usr/local/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File ".venv/lib/python3.9/site-packages/_pytest/assertion/rewrite.py", line 170, in exec_module
    exec(co, module.__dict__)
  File ".venv/lib/python3.9/site-packages/dash/testing/plugin.py", line 98, in <module>
    def dash_thread_server() -> ThreadedRunner:
NameError: name 'ThreadedRunner' is not defined

Expected behavior

No import error.

@alexcjohnson
Copy link
Collaborator

Thanks @vigenere23 - while we work on a fix for this, if you install dash[testing] instead of just dash this problem should disappear.

@alexcjohnson
Copy link
Collaborator

Fix released in Dash 2.4.1 - thanks again for reporting this @vigenere23!

@vigenere23
Copy link
Author

Fix released in Dash 2.4.1 - thanks again for reporting this @vigenere23!

Saw that, updated and confirms it works. Thanks for the fix! :)

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 a pull request may close this issue.

2 participants