Skip to content

3.3.0: pytest is failing in three units #82

Open
@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:

+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-domdf-python-tools-3.3.0-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-domdf-python-tools-3.3.0-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
Test session started at 13:27:29
rootdir: /home/tkloczko/rpmbuild/BUILD/domdf_python_tools-3.3.0, configfile: tox.ini
plugins: datadir-1.3.1, regressions-2.3.1, timeout-2.1.0, Faker-14.1.0
timeout: 300.0s
timeout method: signal
timeout func_only: False
collected 18185 items

tests/test_bases.py ................................................                                                                                                 [  0%]
tests/test_compat.py .                                                                                                                                               [  0%]
tests/test_dates.py ...X...................................................................                                                                          [  0%]
tests/test_delegators.py ...                                                                                                                                         [  0%]
tests/test_dir_comparator.py .......                                                                                                                                 [  0%]
tests/test_docstrings.py .......                                                                                                                                     [  0%]
tests/test_doctools.py ....................s.                                                                                                                        [  0%]
tests/test_getters.py ........................                                                                                                                       [  1%]
tests/test_import_tools.py ............FFFsss.sssssss.sssssss.sssssss.sssssss.sssssss.sssssss.sssssss.ssss                                                           [  1%]
tests/test_iterative.py ..............................................                                                                                               [  1%]
tests/test_namedlist.py ............................................................................................................................................ [  2%]
......                                                                                                                                                               [  2%]
tests/test_paths.py ...........sssss..............................................................................................................                   [  3%]
tests/test_paths_stdlib.py ........s...s........s...................                                                                                                 [  3%]
tests/test_pretty_print.py ...............................................................                                                                           [  3%]
tests/test_secrets.py .............................................................................................................................................. [  4%]
.................................................................................................................................................................... [  5%]
.................................................................................................................................................................... [  6%]
.................................................................................................................................................................... [  7%]
.................................................................................................................................................................... [  8%]
.................................................................................................................................................................... [  9%]
.................................................................................................................................................................... [  9%]
.................................................................................................................................................................... [ 10%]
.................................................................................................................................................................... [ 11%]
.................................................................................................................................................................... [ 12%]
.................................................................................................................................................................... [ 13%]
.................................................................................................................................................................... [ 14%]
.................................................................................................................................................................... [ 15%]
.................................................................................................................................................................... [ 16%]
.................................................................................................................................................................... [ 17%]
.................................................................................................................................................................... [ 18%]
.................................................................................................................................................................... [ 18%]
.................................................................................................................................................................... [ 19%]
.................................................................................................................................................................... [ 20%]
.................................................................................................................................................................... [ 21%]
.................................................................................................................................................................... [ 22%]
.................................................................................................................................................................... [ 23%]
.................................................................................................................................................................... [ 24%]
.................................................................................................................................................................... [ 25%]
.................................................................................................................................................................... [ 26%]
.................................................................................................................................................................... [ 27%]
.................................................................................................................................................................... [ 27%]
.................................................................................................................................................................... [ 28%]
.................................................................................................................................................................... [ 29%]
.................................................................................................................................................................... [ 30%]
.................................................................................................................................................................... [ 31%]
.................................................................................................................................................................... [ 32%]
.................................................................................................................................................................... [ 33%]
.................................................................................................................................................................... [ 34%]
.................................................................................................................................................................... [ 35%]
.................................................................................................................................................................... [ 36%]
.................................................................................................................................................................... [ 37%]
.................................................................................................................................................................... [ 37%]
.................................................................................................................................................................... [ 38%]
.................................................................................................................................................................... [ 39%]
.................................................................................................................................................................... [ 40%]
.................................................................................................................................................................... [ 41%]
.................................................................................................................................................................... [ 42%]
.................................................................................................................................................................... [ 43%]
.................................................................................................................................................................... [ 44%]
.................................................................................................................................................................... [ 45%]
.................................................................................................................................................................... [ 46%]
.................................................................................................................................................................... [ 46%]
.................................................................................................................................................................... [ 47%]
.................................................................................................................................................................... [ 48%]
.................................................................................................................................................................... [ 49%]
.................................................................................................................................................................... [ 50%]
.................................................................................................................................................................... [ 51%]
.................................................................................................................................................................... [ 52%]
.................................................................................................................................................................... [ 53%]
.................................................................................................................................................................... [ 54%]
.................................................................................................................................................................... [ 55%]
.................................................................................................................................................................... [ 55%]
.................................................................................................................................................................... [ 56%]
.................................................................................................................................................................... [ 57%]
............................................................................                                                                                         [ 58%]
tests/test_stringlist.py .........................x.......................                                                                                           [ 58%]
tests/test_terminal.py .s....                                                                                                                                        [ 58%]
tests/test_typing.py ..........................................                                                                                                      [ 58%]
tests/test_userlist.py ............................................................................................................................................. [ 59%]
....                                                                                                                                                                 [ 59%]
tests/test_utils.py ....................................................................................................................................             [ 60%]
tests/test_versions.py ............................................................................................................................................. [ 61%]
........................................................................................................................................                             [ 61%]
tests/test_words.py ..............................................                                                                                                   [ 62%]
tests/test_pagesizes/test_pagesizes.py ................................................................................................                              [ 62%]
tests/test_pagesizes/test_units.py ................................................................................................................................. [ 63%]
.................................................................................................................................................................... [ 64%]
.................................................................................................................................................................... [ 65%]
.................................................................................................................................................................... [ 65%]
.................................................................................................................................................................... [ 66%]
.................................................................................................................................................................... [ 67%]
.................................................................................................................................................................... [ 68%]
.................................................................................................................................................................... [ 69%]
.................................................................................................................................................................... [ 70%]
.................................................................................................................................................................... [ 71%]
.................................................................................................................................................................... [ 72%]
.................................................................................................................................................................... [ 73%]
.................................................................................................................................................................... [ 74%]
.................................................................................................................................................................... [ 74%]
.................................................................................................................................................................... [ 75%]
.................................................................................................................................................................... [ 76%]
.................................................................................................................................................................... [ 77%]
.................................................................................................................................................................... [ 78%]
.................................................................................................................................................................... [ 79%]
.................................................................................................................................................................... [ 80%]
.................................................................................................................................................................... [ 81%]
.................................................................................................................................................................... [ 82%]
.................................................................................................................................................................... [ 83%]
.................................................................................................................................................................... [ 83%]
.................................................................................................................................................................... [ 84%]
.................................................................................................................................................................... [ 85%]
.................................................................................................................................................................... [ 86%]
.................................................................................................................................................................... [ 87%]
.................................................................................................................................................................... [ 88%]
.................................................................................................................................................................... [ 89%]
.................................................................................................................................................................... [ 90%]
.................................................................................................................................................................... [ 91%]
.................................................................................................................................................................... [ 92%]
.................................................................................................................................................................... [ 92%]
.................................................................................................................................................................... [ 93%]
.................................................................................................................................................................... [ 94%]
.................................................................................................................................................................... [ 95%]
.................................................................................................................................................................... [ 96%]
.................................................................................................................................................................... [ 97%]
.................................................................................................................................................................... [ 98%]
.................................................................................................................................................................... [ 99%]
.............................................................................................................................                                        [100%]

================================================================================= FAILURES =================================================================================
________________________________________________________________________ test_discover_entry_points ________________________________________________________________________

advanced_data_regression = <coincidence.regressions.AdvancedDataRegressionFixture object at 0x7f337a72aa90>

    def test_discover_entry_points(advanced_data_regression: AdvancedDataRegressionFixture):
        entry_points = discover_entry_points("flake8.extension", lambda f: f.__name__.startswith("break"))
>       advanced_data_regression.check([f.__name__ for f in entry_points])
E    AssertionError: FILES DIFFER:
E    /tmp/pytest-of-tkloczko/pytest-8/test_discover_entry_points0/test_import_tools_/test_discover_entry_points.yml
E    /tmp/pytest-of-tkloczko/pytest-8/test_discover_entry_points0/test_import_tools_/test_discover_entry_points.obtained.yml
E    HTML DIFF: /tmp/pytest-of-tkloczko/pytest-8/test_discover_entry_points0/test_import_tools_/test_discover_entry_points.obtained.diff.html
E    ---
E    +++
E    @@ -1,2 +1 @@
E    -- break_after_binary_operator
E    -- break_before_binary_operator
E    +[]

tests/test_import_tools.py:110: AssertionError
___________________________________________________________ test_discover_entry_points_by_name_object_match_func ___________________________________________________________

advanced_data_regression = <coincidence.regressions.AdvancedDataRegressionFixture object at 0x7f337a697220>

    def test_discover_entry_points_by_name_object_match_func(advanced_data_regression: AdvancedDataRegressionFixture):
        entry_points = discover_entry_points_by_name(
                        "flake8.extension", object_match_func=lambda f: f.__name__.startswith("break")
                        )
>       advanced_data_regression.check({k: v.__name__ for k, v in entry_points.items()})
E    AssertionError: FILES DIFFER:
E    /tmp/pytest-of-tkloczko/pytest-8/test_discover_entry_points_by_0/test_import_tools_/test_discover_entry_points_by_name_object_match_func.yml
E    /tmp/pytest-of-tkloczko/pytest-8/test_discover_entry_points_by_0/test_import_tools_/test_discover_entry_points_by_name_object_match_func.obtained.yml
E    HTML DIFF: /tmp/pytest-of-tkloczko/pytest-8/test_discover_entry_points_by_0/test_import_tools_/test_discover_entry_points_by_name_object_match_func.obtained.diff.html
E    ---
E    +++
E    @@ -1,2 +1 @@
E    -pycodestyle.break_after_binary_operator: break_after_binary_operator
E    -pycodestyle.break_before_binary_operator: break_before_binary_operator
E    +{}

tests/test_import_tools.py:117: AssertionError
____________________________________________________________ test_discover_entry_points_by_name_name_match_func ____________________________________________________________

advanced_data_regression = <coincidence.regressions.AdvancedDataRegressionFixture object at 0x7f337a71da60>

    def test_discover_entry_points_by_name_name_match_func(advanced_data_regression: AdvancedDataRegressionFixture):
        entry_points = discover_entry_points_by_name(
                        "flake8.extension", name_match_func=lambda n: n.startswith("pycodestyle.")
                        )
>       advanced_data_regression.check({k: v.__name__ for k, v in entry_points.items()})
E    AssertionError: FILES DIFFER:
E    /tmp/pytest-of-tkloczko/pytest-8/test_discover_entry_points_by_1/test_import_tools_/test_discover_entry_points_by_name_name_match_func.yml
E    /tmp/pytest-of-tkloczko/pytest-8/test_discover_entry_points_by_1/test_import_tools_/test_discover_entry_points_by_name_name_match_func.obtained.yml
E    HTML DIFF: /tmp/pytest-of-tkloczko/pytest-8/test_discover_entry_points_by_1/test_import_tools_/test_discover_entry_points_by_name_name_match_func.obtained.diff.html
E    ---
E    +++
E    @@ -1,36 +1 @@
E    -pycodestyle.ambiguous_identifier: ambiguous_identifier
E    -pycodestyle.bare_except: bare_except
E    -pycodestyle.blank_lines: blank_lines
E    -pycodestyle.break_after_binary_operator: break_after_binary_operator
E    -pycodestyle.break_before_binary_operator: break_before_binary_operator
E    -pycodestyle.comparison_negative: comparison_negative
E    -pycodestyle.comparison_to_singleton: comparison_to_singleton
E    -pycodestyle.comparison_type: comparison_type
E    -pycodestyle.compound_statements: compound_statements
E    -pycodestyle.continued_indentation: continued_indentation
E    -pycodestyle.explicit_line_join: explicit_line_join
E    -pycodestyle.extraneous_whitespace: extraneous_whitespace
E    -pycodestyle.imports_on_separate_lines: imports_on_separate_lines
E    -pycodestyle.indentation: indentation
E    -pycodestyle.maximum_doc_length: maximum_doc_length
E    -pycodestyle.maximum_line_length: maximum_line_length
E    -pycodestyle.missing_whitespace: missing_whitespace
E    -pycodestyle.missing_whitespace_after_import_keyword: missing_whitespace_after_import_keyword
E    -pycodestyle.missing_whitespace_around_operator: missing_whitespace_around_operator
E    -pycodestyle.module_imports_on_top_of_file: module_imports_on_top_of_file
E    -pycodestyle.python_3000_async_await_keywords: python_3000_async_await_keywords
E    -pycodestyle.python_3000_backticks: python_3000_backticks
E    -pycodestyle.python_3000_has_key: python_3000_has_key
E    -pycodestyle.python_3000_invalid_escape_sequence: python_3000_invalid_escape_sequence
E    -pycodestyle.python_3000_not_equal: python_3000_not_equal
E    -pycodestyle.python_3000_raise_comma: python_3000_raise_comma
E    -pycodestyle.tabs_obsolete: tabs_obsolete
E    -pycodestyle.tabs_or_spaces: tabs_or_spaces
E    -pycodestyle.trailing_blank_lines: trailing_blank_lines
E    -pycodestyle.trailing_whitespace: trailing_whitespace
E    -pycodestyle.whitespace_around_comma: whitespace_around_comma
E    -pycodestyle.whitespace_around_keywords: whitespace_around_keywords
E    -pycodestyle.whitespace_around_named_parameter_equals: whitespace_around_named_parameter_equals
E    -pycodestyle.whitespace_around_operator: whitespace_around_operator
E    -pycodestyle.whitespace_before_comment: whitespace_before_comment
E    -pycodestyle.whitespace_before_parameters: whitespace_before_parameters
E    +{}

tests/test_import_tools.py:124: AssertionError
=========================================================================== slowest 25 durations ===========================================================================
0.35s teardown tests/test_pagesizes/test_units.py::TestSub::test_rsub_number[990-<Unit '12.000 µm': 0.034pt>]
0.28s call     tests/test_utils.py::TestHead::test_protocol_pandas
0.26s call     tests/test_dates.py::test_converting_timezone
0.15s call     tests/test_pagesizes/test_units.py::TestMul::test_pow_errors[440]
0.13s call     tests/test_dates.py::test_set_timezone
0.11s setup    tests/test_secrets.py::test_secret[jeremy]
0.09s setup    tests/test_secrets.py::test_secret[awards]
0.05s call     tests/test_dates.py::test_utc_timestamp_to_datetime
0.02s call     tests/test_pretty_print.py::TestFancyPrinter::test_str_wrap
0.02s call     tests/test_words.py::test_get_words_list
0.02s call     tests/test_dates.py::test_check_date
0.02s setup    tests/test_bases.py::TestDictable::test_creation
0.02s call     tests/test_paths.py::test_stream
0.02s call     tests/test_paths.py::test_iterchildren_match[True]
0.01s call     tests/test_dates.py::test_utc_offset
0.01s call     tests/test_paths.py::test_iterchildren_match[False]
0.01s call     tests/test_import_tools.py::test_discover_entry_points
0.01s call     tests/test_paths.py::test_iterchildren_exclusions
0.01s call     tests/test_import_tools.py::test_iter_submodules[domdf_python_tools-3.8]
0.01s call     tests/test_docstrings.py::test_docstrings[domdf_python_tools.pagesizes.units]
0.01s call     tests/test_import_tools.py::test_discover_entry_points_by_name_name_match_func
0.01s call     tests/test_pretty_print.py::TestFancyPrinter::test_compact_width
0.01s call     tests/test_import_tools.py::test_discover_entry_points_by_name_object_match_func
0.01s setup    tests/test_import_tools.py::test_discover_entry_points
0.01s setup    tests/test_import_tools.py::test_iter_submodules[importlib-3.8]
========================================================================= short test summary info ==========================================================================
SKIPPED [1] tests/test_doctools.py:500: Not needed after Python v3.7.0.
SKIPPED [8] tests/test_import_tools.py:127: Output differs on Python 3.6
SKIPPED [16] tests/test_import_tools.py:127: Output differs on Python 3.7
SKIPPED [8] tests/test_import_tools.py:127: Output differs on PyPy 3.8
SKIPPED [16] tests/test_import_tools.py:127: Output differs on Python 3.9
SKIPPED [8] tests/test_import_tools.py:127: Output differs on Python 3.10
SKIPPED [5] tests/test_paths.py:181: Windows uses a different path structure.
SKIPPED [1] tests/test_paths_stdlib.py:224: group 1000 doesn't have an entry in the system database
SKIPPED [1] tests/test_paths_stdlib.py:255: os.link() is present
SKIPPED [1] tests/test_paths_stdlib.py:389: test requires a Windows-compatible system
SKIPPED [1] tests/test_terminal.py:45: Different test used for POSIX
XFAIL tests/test_stringlist.py::TestStringList::test_pickle
XPASS tests/test_dates.py::test_set_timezone
FAILED tests/test_import_tools.py::test_discover_entry_points - AssertionError: FILES DIFFER:
FAILED tests/test_import_tools.py::test_discover_entry_points_by_name_object_match_func - AssertionError: FILES DIFFER:
FAILED tests/test_import_tools.py::test_discover_entry_points_by_name_name_match_func - AssertionError: FILES DIFFER:
==================================================== 3 failed, 18114 passed, 66 skipped, 1 xfailed, 1 xpassed in 25.39s ====================================================

Here is list of installed modules in build env

Package                        Version
------------------------------ -----------------
alabaster                      0.7.12
apeye                          1.2.0
appdirs                        1.4.4
asttokens                      2.0.5
attrs                          22.1.0
autodocsumm                    0.2.9
Babel                          2.10.2
backcall                       0.2.0
beautifulsoup4                 4.11.1
bleach                         5.0.0
Brlapi                         0.8.3
build                          0.8.0
CacheControl                   0.12.11
charset-normalizer             2.1.0
click                          8.1.3
codespell                      2.1.0
coincidence                    0.6.2
consolekit                     1.4.1
cssselect                      1.1.0
cssutils                       2.6.0
debugpy                        1.6.3
decorator                      5.1.1
defusedxml                     0.7.1
deprecation                    2.1.0
deprecation-alias              0.3.1
dict2css                       0.3.0
dist-meta                      0.5.0
distro                         1.7.0
docutils                       0.18.1
dom_toml                       0.6.0
domdf-python-tools             3.2.2.post1
entrypoints                    0.4
executing                      0.8.3
extras                         1.0.0
extras-require                 0.4.3
Faker                          14.1.0
fastjsonschema                 2.16.1
fixtures                       4.0.0
funcy                          1.17
gpg                            1.17.1-unknown
handy-archives                 0.1.2
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
jsonschema                     4.13.0
jupyter_client                 7.3.5
jupyter_core                   4.11.1
jupyterlab-pygments            0.1.2
jupytext                       1.14.1
latexcodec                     2.0.1
libcomps                       0.1.18
lockfile                       0.12.2
louis                          3.22.0
lxml                           4.9.1
markdown-it-py                 2.1.0
MarkupSafe                     2.1.1
matplotlib-inline              0.1.5
mdit-py-plugins                0.3.0
mdurl                          0.1.1
mistletoe                      0.9.0
mistune                        2.0.3
msgpack                        1.0.4
natsort                        8.0.2
nbclient                       0.6.7
nbconvert                      7.0.0
nbformat                       5.4.0
nest-asyncio                   1.5.5
numpy                          1.23.1
packaging                      21.3
pandas                         1.4.2
pandocfilters                  1.5.0
parso                          0.8.3
pbr                            5.9.0
pep517                         0.12.0
pexpect                        4.8.0
pickleshare                    0.7.5
pip                            22.2.1
pkgutil_resolve_name           1.3.10
platformdirs                   2.5.2
pluggy                         1.0.0
prompt-toolkit                 3.0.29
psutil                         5.9.0
ptyprocess                     0.7.0
pure-eval                      0.2.2
py                             1.11.0
pybtex                         0.24.0
pybtex-docutils                1.0.2
Pygments                       2.13.0
PyGObject                      3.42.2
pyparsing                      3.0.9
pyrsistent                     0.18.1
pytest                         7.1.2
pytest-datadir                 1.3.1
pytest-regressions             2.3.1
pytest-timeout                 2.1.0
python-dateutil                2.8.2
pytz                           2022.1
PyYAML                         6.0
pyzmq                          23.2.0
requests                       2.28.1
rpm                            4.17.0
ruamel.yaml                    0.17.21
ruamel.yaml.clib               0.2.6
scour                          0.38.2
setuptools                     65.3.0
shippinglabel                  1.4.1
six                            1.16.0
snowballstemmer                2.2.0
soupsieve                      2.3.2.post1
Sphinx                         5.1.1
sphinx-autodoc-typehints       1.19.2
sphinx-codeautolink            0.10.0
sphinx-gallery                 0.11.1
sphinx-jinja2-compat           0.1.2
sphinx-last-updated-by-git     0.3.3
sphinx-prompt                  1.4.0
sphinx-pyproject               0.1.0
sphinx-tabs                    3.4.1
sphinx-toolbox                 3.1.2
sphinxcontrib-applehelp        1.0.2.dev20220730
sphinxcontrib-bibtex           2.5.0
sphinxcontrib-devhelp          1.0.2.dev20220730
sphinxcontrib-htmlhelp         2.0.0
sphinxcontrib-jsmath           1.0.1.dev20220730
sphinxcontrib-qthelp           1.0.3.dev20220730
sphinxcontrib-serializinghtml  1.1.5
sphinxcontrib-svg2pdfconverter 1.2.0
stack-data                     0.4.0
tabulate                       0.8.9
testtools                      2.5.0
tinycss2                       1.1.1
toml                           0.10.2
tomli                          2.0.1
tornado                        6.2
traitlets                      5.3.0
typing_extensions              4.2.0
urllib3                        1.26.12
wcwidth                        0.2.5
webencodings                   0.5.1
wheel                          0.37.1
widgetsnbextension             4.0.2

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingstale

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions