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

5.13.0: pytest is failing with error in tests/test_typing.py #889

Open
kloczek opened this issue Nov 6, 2023 · 1 comment
Open

5.13.0: pytest is failing with error in tests/test_typing.py #889

kloczek opened this issue Nov 6, 2023 · 1 comment

Comments

@kloczek
Copy link

kloczek commented Nov 6, 2023

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> using 'installer` module
  • run pytest with $PYTHONPATH pointing to sitearch and sitelib inside </install/prefix>
  • build is performed in env which is cut off from access to the public network (pytest is executed with -m "not network")

Here is pytest output:

+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-traitlets-5.13.0-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-traitlets-5.13.0-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra -m 'not network'
============================= test session starts ==============================
platform linux -- Python 3.8.18, pytest-7.4.3, pluggy-1.3.0
rootdir: /home/tkloczko/rpmbuild/BUILD/traitlets-5.13.0
configfile: pyproject.toml
testpaths: tests, examples
collected 569 items / 2 errors

==================================== ERRORS ====================================
____________________ ERROR collecting tests/test_typing.py _____________________
'mypy_testing' not found in `markers` configuration option
____________________ ERROR collecting tests/test_typing.py _____________________
'mypy_testing' not found in `markers` configuration option
=========================== short test summary info ============================
ERROR tests/test_typing.py - Failed: 'mypy_testing' not found in `markers` configuration option
ERROR tests/test_typing.py - Failed: 'mypy_testing' not found in `markers` configuration option
!!!!!!!!!!!!!!!!!!! Interrupted: 2 errors during collection !!!!!!!!!!!!!!!!!!!!
============================== 2 errors in 0.77s ===============================

Here is list of installed modules in build env

Package                       Version
----------------------------- ---------
alabaster                     0.7.13
argcomplete                   3.1.4
Babel                         2.13.1
build                         1.0.3
charset-normalizer            3.3.2
cppclean                      0.13
decorator                     5.1.1
distro                        1.8.0
docutils                      0.20.1
editables                     0.5
exceptiongroup                1.1.3
gpg                           1.23.0
hatchling                     1.18.0
idna                          3.4
imagesize                     1.4.1
importlib-metadata            6.8.0
iniconfig                     2.0.0
installer                     0.7.0
Jinja2                        3.1.2
markdown-it-py                3.0.0
MarkupSafe                    2.1.3
mdit-py-plugins               0.4.0
mdurl                         0.1.2
myst-parser                   2.0.0
packaging                     23.2
pathspec                      0.11.2
pluggy                        1.3.0
Pygments                      2.16.1
pyproject_hooks               1.0.0
pytest                        7.4.3
python-dateutil               2.8.2
pytz                          2023.3
PyYAML                        6.0.1
requests                      2.31.0
six                           1.16.0
snowballstemmer               2.2.0
Sphinx                        7.1.2
sphinx-rtd-theme              1.2.2
sphinxcontrib-applehelp       1.0.4
sphinxcontrib-devhelp         1.0.5
sphinxcontrib-htmlhelp        2.0.4
sphinxcontrib-jquery          4.1
sphinxcontrib-jsmath          1.0.1
sphinxcontrib-qthelp          1.0.3
sphinxcontrib-serializinghtml 1.1.9
tomli                         2.0.1
trove-classifiers             2023.11.2
urllib3                       1.26.18
wheel                         0.41.3
@kloczek kloczek changed the title 5.13.0: pytest is failing in tests/test_typing.py 5.13.0: pytest is failing with error in tests/test_typing.py Nov 6, 2023
@kloczek
Copy link
Author

kloczek commented Nov 6, 2023

After add tests/test_typing.py to ignore list pytest is OK in rest of the units

+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-traitlets-5.13.0-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-traitlets-5.13.0-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra -m 'not network' --ignore tests/test_typing.py
============================= test session starts ==============================
platform linux -- Python 3.8.18, pytest-7.4.3, pluggy-1.3.0
rootdir: /home/tkloczko/rpmbuild/BUILD/traitlets-5.13.0
configfile: pyproject.toml
testpaths: tests, examples
plugins: mock-3.12.0
collected 569 items

tests/_warnings.py .s                                                    [  0%]
tests/test_traitlets.py ................................................ [  8%]
........................................................................ [ 21%]
........................................................................ [ 34%]
........................................................................ [ 46%]
........................................................................ [ 59%]
.................................................                        [ 68%]
tests/test_traitlets_docstring.py .                                      [ 68%]
tests/test_traitlets_enum.py ........................                    [ 72%]
tests/config/test_application.py ....................................... [ 79%]
......                                                                   [ 80%]
tests/config/test_argcomplete.py ......                                  [ 81%]
tests/config/test_configurable.py ...................................    [ 87%]
tests/config/test_loader.py ............................................ [ 95%]
..................                                                       [ 98%]
tests/utils/test_bunch.py ..                                             [ 98%]
tests/utils/test_decorators.py .....                                     [ 99%]
tests/utils/test_importstring.py ..                                      [100%]

=============================== warnings summary ===============================
tests/_warnings.py::tests._warnings.all_warnings
  <doctest tests._warnings.all_warnings[1]>:2: RuntimeWarning: bar

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
============================= slowest 10 durations =============================
0.26s call     tests/config/test_application.py::test_show_config_cli
0.25s call     tests/config/test_application.py::test_help_all_output
0.24s call     tests/config/test_application.py::test_help_output
0.23s call     tests/config/test_application.py::test_show_config_json_cli
0.04s call     tests/config/test_argcomplete.py::TestArgcomplete::test_complete_subcommands
0.03s call     tests/config/test_argcomplete.py::TestArgcomplete::test_complete_custom_completers
0.02s call     tests/test_traitlets.py::TestTraitType::test_deprecated_metadata_access
0.01s call     tests/config/test_application.py::test_deep_alias
0.01s call     tests/config/test_argcomplete.py::TestArgcomplete::test_complete_simple_app
0.01s call     tests/test_traitlets.py::TestTraitType::test_deprecated_method_warnings
=========================== short test summary info ============================
SKIPPED [1] ../../../../../usr/lib/python3.8/site-packages/_pytest/doctest.py:456: all tests skipped by +SKIP option
================== 568 passed, 1 skipped, 1 warning in 2.74s ===================

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

No branches or pull requests

1 participant