Skip to content
This repository was archived by the owner on Jun 4, 2024. It is now read-only.

Commit

Permalink
❓ attempt to fix test
Browse files Browse the repository at this point in the history
Getting a Python 2 traceback:
```
Traceback (most recent call last):
  File
"/home/circleci/repo/venv/lib/python2.7/site-packages/flask/app.py",
line 2292, in wsgi_app
    response = self.full_dispatch_request()
  File
"/home/circleci/repo/venv/lib/python2.7/site-packages/flask/app.py",
line 1815, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File
"/home/circleci/repo/venv/lib/python2.7/site-packages/flask/app.py",
line 1718, in handle_user_exception
    reraise(exc_type, exc_value, tb)
  File
"/home/circleci/repo/venv/lib/python2.7/site-packages/flask/app.py",
line 1813, in full_dispatch_request
    rv = self.dispatch_request()
  File
"/home/circleci/repo/venv/lib/python2.7/site-packages/flask/app.py",
line 1799, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/home/circleci/repo/dash/dash/dash.py", line 324, in
serve_layout
    cls=plotly.utils.PlotlyJSONEncoder),
  File "/usr/local/lib/python2.7/json/__init__.py", line 251, in dumps
    sort_keys=sort_keys, **kw).encode(obj)
  File
"/home/circleci/repo/venv/lib/python2.7/site-packages/plotly/utils.py",
line 168, in encode
    encoded_o = super(PlotlyJSONEncoder, self).encode(o)
  File "/usr/local/lib/python2.7/json/encoder.py", line 207, in encode
    chunks = self.iterencode(o, _one_shot=True)
  File "/usr/local/lib/python2.7/json/encoder.py", line 270, in
iterencode
    return _iterencode(o, 0)
  File
"/home/circleci/repo/venv/lib/python2.7/site-packages/plotly/utils.py",
line 236, in default
    return _json.JSONEncoder.default(self, obj)
  File "/usr/local/lib/python2.7/json/encoder.py", line 184, in default
    raise TypeError(repr(o) + " is not JSON serializable")
  File "/home/circleci/repo/dash/dash/development/base_component.py",
line 284, in __repr__
    for wc_attr in self._valid_wildcard_attributes
AttributeError: 'TestComponent' object has no attribute
'_valid_wildcard_attributes'
```
  • Loading branch information
chriddyp committed Mar 30, 2019
1 parent f8eb31a commit 102bc20
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions tests/test_render.py
Original file line number Diff line number Diff line change
Expand Up @@ -1840,8 +1840,12 @@ def test_update_react_version(self):
# (dash-html-components may not support tested React version)
class TestComponent(Component):
def __init__(self, _namespace):
self._type = 'TestComponent'
self._prop_names = []
self._namespace = _namespace
self._valid_wildcard_attributes = []
self.available_properties = []
self.available_wildcard_properties = []
super(TestComponent, self).__init__()

_test_component = TestComponent(_namespace='test-namespace')
Expand Down

0 comments on commit 102bc20

Please sign in to comment.