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

warnings from pytest #475

Closed
prjemian opened this issue Jan 13, 2021 · 3 comments · Fixed by #480
Closed

warnings from pytest #475

prjemian opened this issue Jan 13, 2021 · 3 comments · Fixed by #480
Labels
Milestone

Comments

@prjemian
Copy link
Contributor

tests pass but various warnings (not really a bug, but nuisance noise in the reports):

(bluesky_2021_1) prjemian@poof ~/.../BCDA-APS/apstools $ pytest tests
=================================================================================================== test session starts ====================================================================================================
platform linux -- Python 3.8.2, pytest-6.2.1, py-1.10.0, pluggy-0.13.1
rootdir: /home/prjemian/Documents/projects/BCDA-APS/apstools
collected 66 items                                                                                                                                                                                                         

tests/test_apsbss.py .................                                                                                                                                                                               [ 25%]
tests/test_commandlist.py ......                                                                                                                                                                                     [ 34%]
tests/test_diffractometer.py ..........                                                                                                                                                                              [ 50%]
tests/test_exceltable.py ..                                                                                                                                                                                          [ 53%]
tests/test_export_json.py ..                                                                                                                                                                                         [ 56%]
tests/test_filewriter.py ............                                                                                                                                                                                [ 74%]
tests/test_plans.py ...                                                                                                                                                                                              [ 78%]
tests/test_simple.py .                                                                                                                                                                                               [ 80%]
tests/test_utils.py .............                                                                                                                                                                                    [100%]

===================================================================================================== warnings summary =====================================================================================================
apstools/utils.py:724
  /home/prjemian/Documents/projects/BCDA-APS/apstools/tests/../apstools/utils.py:724: DeprecationWarning: invalid escape sequence \w
    """

apstools/utils.py:738
  /home/prjemian/Documents/projects/BCDA-APS/apstools/tests/../apstools/utils.py:738: DeprecationWarning: invalid escape sequence \w
    noncompliance = '[^\w_]'

../../../../Apps/anaconda/envs/bluesky_2021_1/lib/python3.8/site-packages/pims/cine.py:29
  /home/prjemian/Apps/anaconda/envs/bluesky_2021_1/lib/python3.8/site-packages/pims/cine.py:29: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3, and in 3.9 it will stop working
    from collections import Iterable

../../../../Apps/anaconda/envs/bluesky_2021_1/lib/python3.8/site-packages/mongoquery/__init__.py:7
../../../../Apps/anaconda/envs/bluesky_2021_1/lib/python3.8/site-packages/mongoquery/__init__.py:7
  /home/prjemian/Apps/anaconda/envs/bluesky_2021_1/lib/python3.8/site-packages/mongoquery/__init__.py:7: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated since Python 3.3, and in 3.9 it will stop working
    from collections import Sequence, Mapping

../../../../Apps/anaconda/envs/bluesky_2021_1/lib/python3.8/site-packages/past/builtins/misc.py:45
  /home/prjemian/Apps/anaconda/envs/bluesky_2021_1/lib/python3.8/site-packages/past/builtins/misc.py:45: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
    from imp import reload

tests/test_export_json.py: 2926 warnings
tests/test_utils.py: 2926 warnings
  /home/prjemian/Apps/anaconda/envs/bluesky_2021_1/lib/python3.8/site-packages/databroker/v1.py:961: PendingDeprecationWarning: The method Broker.insert may be removed in a future release of databroker.
    warnings.warn(

-- Docs: https://docs.pytest.org/en/stable/warnings.html
============================================================================================ 66 passed, 5858 warnings in 30.64s ============================================================================================
@prjemian prjemian added the bug label Jan 13, 2021
@prjemian prjemian added this to the 1.4.0 milestone Jan 13, 2021
@prjemian
Copy link
Contributor Author

Also, while building the docs now:

/home/prjemian/Documents/projects/BCDA-APS/apstools/apstools/devices.py:docstring of apstools.devices.KohzuSeqCtl_Monochromator.calibrate_energy:4: WARNING: Unexpected section title.

Parameters
----------
/home/prjemian/Documents/projects/BCDA-APS/apstools/apstools/devices.py:docstring of apstools.devices.TrackingSignal.check_value:4: WARNING: Unexpected section title.

@prjemian
Copy link
Contributor Author

The PendingDeprecationWarning about Broker.insert applies to utils.json_export() and utils.json_import(). AFAIK, this is not used by any beam line at APS. It is only used here for unit testing. There is a newer way to do this, using using databroker-pack (command-line tool).

@prjemian
Copy link
Contributor Author

The other warnings (about collections, imp, and importlib) are from upstream packages and cannot be addressed here except to choose different version requirements or refactor to other packages. Hopefully, those warnings will be addressed in future versions of the upstream packages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant