Skip to content

0.12.33: pytest is failing in few units #1512

@kloczek

Description

@kloczek

I'm packaging your module as an rpm package so I'm using the typical PEP517 based build, install and test cycle used on building packages from non-root account.

  • python3 -sBm build -w --no-isolation
  • because I'm calling build with --no-isolation I'm using during all processes only locally installed modules
  • install .whl file in </install/prefix>
  • run pytest with PYTHONPATH pointing to sitearch and sitelib inside </install/prefix>

Here is pytest output:

Details
+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-bqplot-0.12.33-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-bqplot-0.12.33-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.13, pytest-7.1.2, pluggy-1.0.0
rootdir: /home/tkloczko/rpmbuild/BUILD/bqplot-0.12.33, configfile: pytest.ini
plugins: anyio-3.6.1, nbval-0.9.6
collected 952 items

examples/Index.ipynb .                                                                                                                                               [  0%]
examples/Introduction.ipynb ...............................                                                                                                          [  3%]
examples/Advanced Plotting/Advanced Plotting.ipynb ..............                                                                                                    [  4%]
examples/Advanced Plotting/Animations.ipynb ...............                                                                                                          [  6%]
examples/Advanced Plotting/Axis Properties.ipynb .........................                                                                                           [  9%]
examples/Advanced Plotting/Plotting Dates.ipynb ...............                                                                                                      [ 10%]
examples/Applications/Feature_Vector_Distribution-Iris-Digits.ipynb ..FFFF                                                                                           [ 11%]
examples/Applications/Mobile Patent Suits.ipynb ...                                                                                                                  [ 11%]
examples/Applications/Neural Network.ipynb ...                                                                                                                       [ 11%]
examples/Applications/Outlier Detection.ipynb .........                                                                                                              [ 12%]
examples/Applications/Visualizing the US Elections.ipynb ..........FF.......                                                                                         [ 14%]
examples/Applications/Equity Index Performance/Time Series.ipynb ...                                                                                                 [ 15%]
examples/Applications/Logs Analytics/Logs Dashboard.ipynb ............                                                                                               [ 16%]
examples/Applications/Wealth Of Nations/Bubble Chart.ipynb ........                                                                                                  [ 17%]
examples/Applications/Wealth Of Nations/Choropleth.ipynb ........                                                                                                    [ 18%]
examples/Basic Plotting/Basic Plotting.ipynb .........                                                                                                               [ 19%]
examples/Basic Plotting/Pyplot.ipynb .........................................                                                                                       [ 23%]
examples/Interactions/Interaction Layer.ipynb .......................................................                                                                [ 29%]
examples/Interactions/Mark Interactions.ipynb .....................                                                                                                  [ 31%]
examples/Interactions/Selectors.ipynb .............                                                                                                                  [ 32%]
examples/Marks/Object Model/Bars.ipynb ......................                                                                                                        [ 34%]
examples/Marks/Object Model/Bins.ipynb ...........                                                                                                                   [ 36%]
examples/Marks/Object Model/Boxplot.ipynb ......                                                                                                                     [ 36%]
examples/Marks/Object Model/Candles.ipynb ..........                                                                                                                 [ 37%]
examples/Marks/Object Model/FlexLine.ipynb ....                                                                                                                      [ 38%]
examples/Marks/Object Model/Graph.ipynb .............                                                                                                                [ 39%]
examples/Marks/Object Model/GridHeatMap.ipynb .................                                                                                                      [ 41%]
examples/Marks/Object Model/HeatMap.ipynb .....                                                                                                                      [ 41%]
examples/Marks/Object Model/Hist.ipynb ...........                                                                                                                   [ 43%]
examples/Marks/Object Model/Image.ipynb ......                                                                                                                       [ 43%]
examples/Marks/Object Model/Label.ipynb ........                                                                                                                     [ 44%]
examples/Marks/Object Model/Lines.ipynb ............................                                                                                                 [ 47%]
examples/Marks/Object Model/Map.ipynb ........                                                                                                                       [ 48%]
examples/Marks/Object Model/Market Map.ipynb ...............                                                                                                         [ 49%]
examples/Marks/Object Model/Pie.ipynb ...............                                                                                                                [ 51%]
examples/Marks/Object Model/Scatter.ipynb .......................................                                                                                    [ 55%]
examples/Marks/Object Model/ScatterMega.ipynb ....................................                                                                                   [ 59%]
examples/Marks/Pyplot/Bars.ipynb ...................                                                                                                                 [ 61%]
examples/Marks/Pyplot/Bins.ipynb ...........                                                                                                                         [ 62%]
examples/Marks/Pyplot/Boxplot.ipynb ......                                                                                                                           [ 63%]
examples/Marks/Pyplot/Candles.ipynb .........                                                                                                                        [ 64%]
examples/Marks/Pyplot/GridHeatMap.ipynb .................                                                                                                            [ 65%]
examples/Marks/Pyplot/HeatMap.ipynb .....                                                                                                                            [ 66%]
examples/Marks/Pyplot/Hist.ipynb ...........                                                                                                                         [ 67%]
examples/Marks/Pyplot/Image.ipynb ......                                                                                                                             [ 68%]
examples/Marks/Pyplot/Label.ipynb ........                                                                                                                           [ 69%]
examples/Marks/Pyplot/Lines.ipynb ........................                                                                                                           [ 71%]
examples/Marks/Pyplot/Map.ipynb .........                                                                                                                            [ 72%]
examples/Marks/Pyplot/Pie.ipynb ..............                                                                                                                       [ 73%]
examples/Marks/Pyplot/Scatter.ipynb .....................................                                                                                            [ 77%]
examples/Scales/Color Scales.ipynb .................                                                                                                                 [ 79%]
examples/Tutorials/Brush Interval Selector.ipynb ......                                                                                                              [ 80%]
examples/Tutorials/Fast Interval Selector.ipynb ......                                                                                                               [ 80%]
examples/Tutorials/Gaussian Density Widget.ipynb .....                                                                                                               [ 81%]
examples/Tutorials/Gaussian Density.ipynb .....                                                                                                                      [ 81%]
examples/Tutorials/Linking Plots With Widgets.ipynb .......                                                                                                          [ 82%]
examples/Tutorials/Object Model.ipynb ....                                                                                                                           [ 83%]
examples/Tutorials/Pyplot.ipynb ....                                                                                                                                 [ 83%]
examples/Tutorials/Updating Plots.ipynb .......                                                                                                                      [ 84%]
tests/binary_serialization_test.py .....                                                                                                                             [ 84%]
tests/marks_test.py ....                                                                                                                                             [ 85%]
tests/selector_test.py .                                                                                                                                             [ 85%]
ui-tests/tests/notebooks/bars.ipynb ......                                                                                                                           [ 85%]
ui-tests/tests/notebooks/bars2d_update.ipynb ........                                                                                                                [ 86%]
ui-tests/tests/notebooks/bars_update.ipynb .........                                                                                                                 [ 87%]
ui-tests/tests/notebooks/figure_pyplot.ipynb ...                                                                                                                     [ 88%]
ui-tests/tests/notebooks/graph.ipynb ..                                                                                                                              [ 88%]
ui-tests/tests/notebooks/graph_update.ipynb ........                                                                                                                 [ 89%]
ui-tests/tests/notebooks/gridheatmap.ipynb .....                                                                                                                     [ 89%]
ui-tests/tests/notebooks/gridheatmap_update.ipynb .........                                                                                                          [ 90%]
ui-tests/tests/notebooks/hist_update.ipynb ........                                                                                                                  [ 91%]
ui-tests/tests/notebooks/index_selector_update.ipynb ..                                                                                                              [ 91%]
ui-tests/tests/notebooks/lines.ipynb ..                                                                                                                              [ 91%]
ui-tests/tests/notebooks/lines_update.ipynb ............                                                                                                             [ 93%]
ui-tests/tests/notebooks/map.ipynb .                                                                                                                                 [ 93%]
ui-tests/tests/notebooks/ohlc_update.ipynb ..........                                                                                                                [ 94%]
ui-tests/tests/notebooks/ordinal_scale.ipynb ....                                                                                                                    [ 94%]
ui-tests/tests/notebooks/pie_update.ipynb ....................                                                                                                       [ 96%]
ui-tests/tests/notebooks/scatter.ipynb ..                                                                                                                            [ 96%]
ui-tests/tests/notebooks/scatter_update.ipynb ............                                                                                                           [ 98%]
ui-tests/tests/notebooks/scattergl_update.ipynb .............                                                                                                        [ 99%]
ui-tests/tests/notebooks/ticks.ipynb ....                                                                                                                            [100%]

================================================================================= FAILURES =================================================================================
_______________________________________________ examples/Applications/Feature_Vector_Distribution-Iris-Digits.ipynb::Cell 2 ________________________________________________
Notebook cell execution failed
Cell 2: Cell execution caused an exception

Input:
import pandas as pd
from sklearn.datasets import load_iris
from sklearn.decomposition import PCA
from sklearn.preprocessing import scale

np.random.seed(42)

digits = load_iris()
data = scale(digits.data)
n_features=4
#n_pca=3
#pca = PCA(n_components=n_pca).fit(data)
df = pd.DataFrame(data, columns=['feature_{}'.format(x) for x in range(n_features)])
df['leaf'] = digits.target
df['extra_info'] = [np.random.randint(100) for x in range(digits.target.shape[0])]

Traceback:

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
Input In [3], in <cell line: 2>()
      1 import pandas as pd
----> 2 from sklearn.datasets import load_iris
      3 from sklearn.decomposition import PCA
      4 from sklearn.preprocessing import scale

ModuleNotFoundError: No module named 'sklearn'

_______________________________________________ examples/Applications/Feature_Vector_Distribution-Iris-Digits.ipynb::Cell 3 ________________________________________________
Notebook cell execution failed
Cell 3: Cell execution caused an exception

Input:
feature_vector_distribution(df, 'leaf',
                                group_columns=['extra_info'],
                                bins=25,
                                f_lim = {'min':-3, 'max':3}
                                )

Traceback:

---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
Input In [4], in <cell line: 1>()
----> 1 feature_vector_distribution(df, 'leaf',
      2                                 group_columns=['extra_info'],
      3                                 bins=25,
      4                                 f_lim = {'min':-3, 'max':3}
      5                                 )

NameError: name 'df' is not defined

_______________________________________________ examples/Applications/Feature_Vector_Distribution-Iris-Digits.ipynb::Cell 4 ________________________________________________
Notebook cell execution failed
Cell 4: Cell execution caused an exception

Input:
import numpy as np
import pandas as pd
from sklearn.datasets import load_digits
from sklearn.decomposition import PCA
from sklearn.preprocessing import scale

np.random.seed(42)

digits = load_digits()
data = scale(digits.data)

n_pca=10
pca = PCA(n_components=n_pca).fit(data)
df = pd.DataFrame(pca.transform(data), columns=['pca_{}'.format(x) for x in range(n_pca)])
df['digit'] = digits.target
df['test'] = [np.random.randint(100) for x in range(digits.target.shape[0])]

Traceback:

---------------------------------------------------------------------------
ModuleNotFoundError                       Traceback (most recent call last)
Input In [5], in <cell line: 3>()
      1 import numpy as np
      2 import pandas as pd
----> 3 from sklearn.datasets import load_digits
      4 from sklearn.decomposition import PCA
      5 from sklearn.preprocessing import scale

ModuleNotFoundError: No module named 'sklearn'

_______________________________________________ examples/Applications/Feature_Vector_Distribution-Iris-Digits.ipynb::Cell 5 ________________________________________________
Notebook cell execution failed
Cell 5: Cell execution caused an exception

Input:
feature_vector_distribution(df, 'digit',
                                group_columns=['test'],
                                bins=20,
                                f_lim = {'min':-7, 'max':7}
                                )

Traceback:

---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
Input In [6], in <cell line: 1>()
----> 1 feature_vector_distribution(df, 'digit',
      2                                 group_columns=['test'],
      3                                 bins=20,
      4                                 f_lim = {'min':-7, 'max':7}
      5                                 )

NameError: name 'df' is not defined

____________________________________________________ examples/Applications/Visualizing the US Elections.ipynb::Cell 10 _____________________________________________________
Notebook cell execution failed
Cell 10: Cell execution caused an exception

Input:
national = data[(data['State']=='US') & (data['Trump'] > 0.) & (data['Clinton'] > 0.)].sort_values(by='Date')

dt_x = DateScale()
sc_y = LinearScale()

clinton_scatter = Scatter(x=national['Date'].values.astype(np.datetime64), y=national['Clinton'],
                          scales={'x': dt_x, 'y': sc_y},
                          colors=['#2aa1ec'])

trump_scatter = Scatter(x=national['Date'].values.astype(np.datetime64), y=national['Trump'],
                        scales={'x': dt_x, 'y': sc_y},
                        colors=['#E91D0E'])

ax_x = Axis(scale=dt_x, label='Date', tick_format='%b-%Y', num_ticks=8)
ax_y = Axis(scale=sc_y, orientation='vertical', label='Percentage')

scat_fig = Figure(marks=[clinton_scatter, trump_scatter], axes=[ax_x, ax_y], title='General Election - National Polls')

Traceback:

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
Input In [11], in <cell line: 6>()
      3 dt_x = DateScale()
      4 sc_y = LinearScale()
----> 6 clinton_scatter = Scatter(x=national['Date'].values.astype(np.datetime64), y=national['Clinton'],
      7                           scales={'x': dt_x, 'y': sc_y},
      8                           colors=['#2aa1ec'])
     10 trump_scatter = Scatter(x=national['Date'].values.astype(np.datetime64), y=national['Trump'],
     11                         scales={'x': dt_x, 'y': sc_y},
     12                         colors=['#E91D0E'])
     14 ax_x = Axis(scale=dt_x, label='Date', tick_format='%b-%Y', num_ticks=8)

File ~/rpmbuild/BUILDROOT/python-bqplot-0.12.33-2.fc35.x86_64/usr/lib/python3.8/site-packages/bqplot/marks.py:547, in _ScatterBase.__init__(self, **kwargs)
    545 self._drag_handlers = CallbackDispatcher()
    546 self._drag_end_handlers = CallbackDispatcher()
--> 547 super(_ScatterBase, self).__init__(**kwargs)
    549 self._name_to_handler.update({
    550     'drag_start': self._drag_start_handlers,
    551     'drag_end': self._drag_end_handlers,
    552     'drag': self._drag_handlers
    553 })

File ~/rpmbuild/BUILDROOT/python-bqplot-0.12.33-2.fc35.x86_64/usr/lib/python3.8/site-packages/bqplot/marks.py:242, in Mark.__init__(self, **kwargs)
    241 def __init__(self, **kwargs):
--> 242     super(Mark, self).__init__(**kwargs)
    243     self._hover_handlers = CallbackDispatcher()
    244     self._click_handlers = CallbackDispatcher()

File /usr/lib/python3.8/site-packages/ipywidgets/widgets/widget.py:480, in Widget.__init__(self, **kwargs)
    477 super(Widget, self).__init__(**kwargs)
    479 Widget._call_widget_constructed(self)
--> 480 self.open()

File /usr/lib/python3.8/site-packages/ipywidgets/widgets/widget.py:493, in Widget.open(self)
    491 """Open a comm to the frontend if one isn't already open."""
    492 if self.comm is None:
--> 493     state, buffer_paths, buffers = _remove_buffers(self.get_state())
    495     args = dict(target_name='jupyter.widget',
    496                 data={'state': state, 'buffer_paths': buffer_paths},
    497                 buffers=buffers,
    498                 metadata={'version': __protocol_version__}
    499                 )
    500     if self._model_id is not None:

File /usr/lib/python3.8/site-packages/ipywidgets/widgets/widget.py:583, in Widget.get_state(self, key, drop_defaults)
    581 for k in keys:
    582     to_json = self.trait_metadata(k, 'to_json', self._trait_to_json)
--> 583     value = to_json(getattr(self, k), self)
    584     if not PY3 and isinstance(traits[k], Bytes) and isinstance(value, bytes):
    585         value = memoryview(value)

File ~/rpmbuild/BUILDROOT/python-bqplot-0.12.33-2.fc35.x86_64/usr/lib/python3.8/site-packages/bqplot/traits.py:177, in array_to_json(ar, obj, force_contiguous)
    175         return [array_to_json(np.array(row), obj, force_contiguous) for row in ar]
    176     else:
--> 177         raise ValueError("Unsupported dtype object")
    179 if ar.dtype.kind in ['S', 'U']:  # strings to as plain json
    180     return ar.tolist()

ValueError: Unsupported dtype object

____________________________________________________ examples/Applications/Visualizing the US Elections.ipynb::Cell 11 _____________________________________________________
Notebook cell execution failed
Cell 11: Cell execution caused an exception

Input:
VBox([map_fig, scat_fig])

Traceback:

---------------------------------------------------------------------------
NameError                                 Traceback (most recent call last)
Input In [12], in <cell line: 1>()
----> 1 VBox([map_fig, scat_fig])

NameError: name 'scat_fig' is not defined

============================================================================= warnings summary =============================================================================
../../../../../usr/lib/python3.8/site-packages/traittypes/traittypes.py:20
  /usr/lib/python3.8/site-packages/traittypes/traittypes.py:20: DeprecationWarning:
              Sentinel is not a public part of the traitlets API.
              It was published by mistake, and may be removed in the future.

    Empty = Sentinel('Empty', 'traittypes',

../../../../../usr/lib/python3.8/site-packages/_pytest/nodes.py:633: 81 warnings
  /usr/lib/python3.8/site-packages/_pytest/nodes.py:633: PytestRemovedIn8Warning: The (fspath: py.path.local) argument to IPyNbFile is deprecated. Please use the (path: pathlib.Path) argument instead.
  See https://docs.pytest.org/en/latest/deprecations.html#fspath-argument-for-node-constructors-replaced-with-pathlib-path
    return super().from_parent(parent=parent, fspath=fspath, path=path, **kw)

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
========================================================================= short test summary info ==========================================================================
FAILED examples/Applications/Feature_Vector_Distribution-Iris-Digits.ipynb::Cell 2
FAILED examples/Applications/Feature_Vector_Distribution-Iris-Digits.ipynb::Cell 3
FAILED examples/Applications/Feature_Vector_Distribution-Iris-Digits.ipynb::Cell 4
FAILED examples/Applications/Feature_Vector_Distribution-Iris-Digits.ipynb::Cell 5
FAILED examples/Applications/Visualizing the US Elections.ipynb::Cell 10
FAILED examples/Applications/Visualizing the US Elections.ipynb::Cell 11
========================================================== 6 failed, 946 passed, 82 warnings in 358.07s (0:05:58) ==========================================================

Here list of modules installed in build env

Details
Package                       Version
----------------------------- -----------------
alabaster                     0.7.12
anyio                         3.6.1
appdirs                       1.4.4
argon2-cffi                   21.1.0
asttokens                     2.0.5
attrs                         22.1.0.dev0
Babel                         2.10.2
backcall                      0.2.0
beautifulsoup4                4.10.0
bleach                        5.0.0
Brlapi                        0.8.3
build                         0.8.0
cffi                          1.15.1
charset-normalizer            2.1.0
codespell                     2.1.0
coverage                      6.4.2
cssselect                     1.1.0
cycler                        0.11.0
debugpy                       1.6.2
decorator                     5.1.1
defusedxml                    0.7.1
deprecation                   2.1.0
distro                        1.7.0
docutils                      0.18.1
entrypoints                   0.4
executing                     0.8.3
extras                        1.0.0
fastjsonschema                2.16.1
fixtures                      4.0.0
fonttools                     4.34.4
gpg                           1.17.1-unknown
html5lib                      1.1
idna                          3.3
imagesize                     1.4.1
importlib-metadata            4.12.0
importlib-resources           5.9.0
iniconfig                     1.1.1
ipykernel                     6.15.1
ipython                       8.4.0
ipython-genutils              0.2.0
ipywidgets                    7.7.0
jedi                          0.18.1
Jinja2                        3.1.1
joblib                        1.1.0
json5                         0.9.8
jsonschema                    4.7.2
jupyter-client                7.3.4
jupyter-core                  4.11.1
jupyter-packaging             0.12.2
jupyter-server                1.18.1
jupyter-sphinx                0.4.0
jupyterlab                    3.4.2
jupyterlab-pygments           0.1.2
jupyterlab-server             2.15.0
kiwisolver                    1.4.4
libcomps                      0.1.18
louis                         3.22.0
lxml                          4.9.1
MarkupSafe                    2.1.1
matplotlib                    3.5.2
matplotlib-inline             0.1.3
mistune                       2.0.3
nbclassic                     0.4.2
nbclient                      0.6.6
nbconvert                     6.5.0
nbformat                      5.4.0
nbval                         0.9.6
nest-asyncio                  1.5.5
notebook                      6.4.12
notebook-shim                 0.1.0
numpy                         1.23.1
olefile                       0.46
packaging                     21.3
pandas                        1.4.2
pandocfilters                 1.5.0
parso                         0.8.3
pbr                           5.8.1
pep517                        0.12.0
pexpect                       4.8.0
pickleshare                   0.7.5
Pillow                        9.2.0
pip                           22.0.4
pluggy                        1.0.0
ply                           3.11
Pollster                      0.1.6
prometheus-client             0.14.1
prompt-toolkit                3.0.29
psutil                        5.9.0
ptyprocess                    0.7.0
pure-eval                     0.2.2
py                            1.11.0
pycparser                     2.21
Pygments                      2.12.0
PyGObject                     3.42.2
pyparsing                     3.0.9
pyrsistent                    0.18.1
pytest                        7.1.2
python-dateutil               2.8.2
pytz                          2022.1
pyzmq                         23.2.0
requests                      2.28.1
rpm                           4.17.0
scikit-learn                  1.1.1
scipy                         1.8.1
scour                         0.38.2
Send2Trash                    1.8.0
setuptools                    63.2.0
six                           1.16.0
sklearn                       0.0
sniffio                       1.2.0
snowballstemmer               2.2.0
soupsieve                     2.3.2.post1
Sphinx                        5.1.1
sphinx-rtd-theme              1.0.0
sphinx-thebe                  0.1.2
sphinxcontrib-applehelp       1.0.2.dev20220714
sphinxcontrib-devhelp         1.0.2.dev20220714
sphinxcontrib-htmlhelp        2.0.0
sphinxcontrib-jsmath          1.0.1.dev20220712
sphinxcontrib-qthelp          1.0.3.dev20220712
sphinxcontrib-serializinghtml 1.1.5
stack-data                    0.3.0
terminado                     0.15.0
testtools                     2.5.0
threadpoolctl                 3.1.0
tinycss2                      1.1.1
tomli                         2.0.1
tomlkit                       0.11.1
tornado                       6.1
traitlets                     5.3.0
traittypes                    0.2.1
urllib3                       1.26.9
wcwidth                       0.2.5
webencodings                  0.5.1
websocket-client              1.3.2
wheel                         0.37.1
widgetsnbextension            3.6.0
zipp                          3.8.1

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions