Code Monkey home page Code Monkey logo

Comments (5)

kloczek avatar kloczek commented on August 15, 2024

Just tested 0.9.0:

+ /usr/bin/pytest -ra
ERROR: usage: pytest [options] [file_or_dir] [file_or_dir] [...]
pytest: error: unrecognized arguments: --pydocstyle --pycodestyle
  inifile: /home/tkloczko/rpmbuild/BUILD/dictdiffer-0.9.0/pytest.ini
  rootdir: /home/tkloczko/rpmbuild/BUILD/dictdiffer-0.9.0

After remove those unrecognized options from pytest.ini:

+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-dictdiffer-0.9.0-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-dictdiffer-0.9.0-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-dictdiffer-0.9.0-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-dictdiffer-0.9.0-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.11, pytest-6.2.4, py-1.10.0, pluggy-0.13.1
benchmark: 3.4.1 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10 warmup=False warmup_iterations=100000)
Using --randomly-seed=2890740888
rootdir: /home/tkloczko/rpmbuild/BUILD/dictdiffer-0.9.0, configfile: pytest.ini, testpaths: tests, dictdiffer
plugins: forked-1.3.0, shutil-1.7.0, virtualenv-1.7.0, expect-1.1.0, httpbin-1.0.0, flake8-1.0.7, timeout-1.4.2, betamax-0.8.1, freezegun-0.4.2, case-1.5.3, isort-1.3.0, aspectlib-1.5.2, asyncio-0.15.1, toolbox-0.5, xprocess-0.17.1, aiohttp-0.3.0, checkdocs-2.7.0, mock-3.6.1, rerunfailures-9.1.1, requests-mock-1.9.3, cov-2.12.1, pyfakefs-4.5.0, flaky-3.7.0, hypothesis-6.14.0, benchmark-3.4.1, xdist-2.3.0, pylama-7.7.1, datadir-1.3.1, regressions-2.2.0, cases-3.6.3, Faker-8.10.0, randomly-3.8.0
collected 106 items / 7 errors / 99 selected
Coverage.py warning: No data was collected. (no-data-collected)

================================================================================== ERRORS ==================================================================================
_________________________________________________________________ ERROR collecting dictdiffer/conflict.py __________________________________________________________________
/usr/lib/python3.8/site-packages/_pytest/runner.py:311: in from_call
    result: Optional[TResult] = func()
/usr/lib/python3.8/site-packages/_pytest/runner.py:341: in <lambda>
    call = CallInfo.from_call(lambda: list(collector.collect()), "collect")
/usr/lib/python3.8/site-packages/_pytest/doctest.py:532: in collect
    module = import_path(self.fspath)
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:544: in import_path
    raise ImportPathMismatchError(module_name, module_file, path)
E   _pytest.pathlib.ImportPathMismatchError: ('dictdiffer.conflict', '/home/tkloczko/rpmbuild/BUILDROOT/python-dictdiffer-0.9.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/dictdiffer/conflict.py', PosixPath('/home/tkloczko/rpmbuild/BUILD/dictdiffer-0.9.0/dictdiffer/conflict.py'))
___________________________________________________________________ ERROR collecting dictdiffer/merge.py ___________________________________________________________________
/usr/lib/python3.8/site-packages/_pytest/runner.py:311: in from_call
    result: Optional[TResult] = func()
/usr/lib/python3.8/site-packages/_pytest/runner.py:341: in <lambda>
    call = CallInfo.from_call(lambda: list(collector.collect()), "collect")
/usr/lib/python3.8/site-packages/_pytest/doctest.py:532: in collect
    module = import_path(self.fspath)
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:544: in import_path
    raise ImportPathMismatchError(module_name, module_file, path)
E   _pytest.pathlib.ImportPathMismatchError: ('dictdiffer.merge', '/home/tkloczko/rpmbuild/BUILDROOT/python-dictdiffer-0.9.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/dictdiffer/merge.py', PosixPath('/home/tkloczko/rpmbuild/BUILD/dictdiffer-0.9.0/dictdiffer/merge.py'))
__________________________________________________________________ ERROR collecting dictdiffer/resolve.py __________________________________________________________________
/usr/lib/python3.8/site-packages/_pytest/runner.py:311: in from_call
    result: Optional[TResult] = func()
/usr/lib/python3.8/site-packages/_pytest/runner.py:341: in <lambda>
    call = CallInfo.from_call(lambda: list(collector.collect()), "collect")
/usr/lib/python3.8/site-packages/_pytest/doctest.py:532: in collect
    module = import_path(self.fspath)
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:544: in import_path
    raise ImportPathMismatchError(module_name, module_file, path)
E   _pytest.pathlib.ImportPathMismatchError: ('dictdiffer.resolve', '/home/tkloczko/rpmbuild/BUILDROOT/python-dictdiffer-0.9.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/dictdiffer/resolve.py', PosixPath('/home/tkloczko/rpmbuild/BUILD/dictdiffer-0.9.0/dictdiffer/resolve.py'))
__________________________________________________________________ ERROR collecting dictdiffer/testing.py __________________________________________________________________
/usr/lib/python3.8/site-packages/_pytest/runner.py:311: in from_call
    result: Optional[TResult] = func()
/usr/lib/python3.8/site-packages/_pytest/runner.py:341: in <lambda>
    call = CallInfo.from_call(lambda: list(collector.collect()), "collect")
/usr/lib/python3.8/site-packages/_pytest/doctest.py:532: in collect
    module = import_path(self.fspath)
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:544: in import_path
    raise ImportPathMismatchError(module_name, module_file, path)
E   _pytest.pathlib.ImportPathMismatchError: ('dictdiffer.testing', '/home/tkloczko/rpmbuild/BUILDROOT/python-dictdiffer-0.9.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/dictdiffer/testing.py', PosixPath('/home/tkloczko/rpmbuild/BUILD/dictdiffer-0.9.0/dictdiffer/testing.py'))
___________________________________________________________________ ERROR collecting dictdiffer/unify.py ___________________________________________________________________
/usr/lib/python3.8/site-packages/_pytest/runner.py:311: in from_call
    result: Optional[TResult] = func()
/usr/lib/python3.8/site-packages/_pytest/runner.py:341: in <lambda>
    call = CallInfo.from_call(lambda: list(collector.collect()), "collect")
/usr/lib/python3.8/site-packages/_pytest/doctest.py:532: in collect
    module = import_path(self.fspath)
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:544: in import_path
    raise ImportPathMismatchError(module_name, module_file, path)
E   _pytest.pathlib.ImportPathMismatchError: ('dictdiffer.unify', '/home/tkloczko/rpmbuild/BUILDROOT/python-dictdiffer-0.9.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/dictdiffer/unify.py', PosixPath('/home/tkloczko/rpmbuild/BUILD/dictdiffer-0.9.0/dictdiffer/unify.py'))
___________________________________________________________________ ERROR collecting dictdiffer/utils.py ___________________________________________________________________
/usr/lib/python3.8/site-packages/_pytest/runner.py:311: in from_call
    result: Optional[TResult] = func()
/usr/lib/python3.8/site-packages/_pytest/runner.py:341: in <lambda>
    call = CallInfo.from_call(lambda: list(collector.collect()), "collect")
/usr/lib/python3.8/site-packages/_pytest/doctest.py:532: in collect
    module = import_path(self.fspath)
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:544: in import_path
    raise ImportPathMismatchError(module_name, module_file, path)
E   _pytest.pathlib.ImportPathMismatchError: ('dictdiffer.utils', '/home/tkloczko/rpmbuild/BUILDROOT/python-dictdiffer-0.9.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/dictdiffer/utils.py', PosixPath('/home/tkloczko/rpmbuild/BUILD/dictdiffer-0.9.0/dictdiffer/utils.py'))
__________________________________________________________________ ERROR collecting dictdiffer/version.py __________________________________________________________________
/usr/lib/python3.8/site-packages/_pytest/runner.py:311: in from_call
    result: Optional[TResult] = func()
/usr/lib/python3.8/site-packages/_pytest/runner.py:341: in <lambda>
    call = CallInfo.from_call(lambda: list(collector.collect()), "collect")
/usr/lib/python3.8/site-packages/_pytest/doctest.py:532: in collect
    module = import_path(self.fspath)
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:544: in import_path
    raise ImportPathMismatchError(module_name, module_file, path)
E   _pytest.pathlib.ImportPathMismatchError: ('dictdiffer.version', '/home/tkloczko/rpmbuild/BUILDROOT/python-dictdiffer-0.9.0-2.fc35.x86_64/usr/lib/python3.8/site-packages/dictdiffer/version.py', PosixPath('/home/tkloczko/rpmbuild/BUILD/dictdiffer-0.9.0/dictdiffer/version.py'))

---------- coverage: platform linux, python 3.8.11-final-0 -----------
Name                     Stmts   Miss  Cover   Missing
------------------------------------------------------
dictdiffer/__init__.py     138    138     0%   11-392
dictdiffer/conflict.py      28     28     0%   9-79
dictdiffer/merge.py         42     42     0%   10-142
dictdiffer/resolve.py       51     51     0%   10-152
dictdiffer/testing.py        6      6     0%   8-36
dictdiffer/unify.py         19     19     0%   9-53
dictdiffer/utils.py        110    110     0%   10-281
dictdiffer/version.py        2      2     0%   4-6
------------------------------------------------------
TOTAL                      396    396     0%

========================================================================= short test summary info ==========================================================================
ERROR dictdiffer/conflict.py - _pytest.pathlib.ImportPathMismatchError: ('dictdiffer.conflict', '/home/tkloczko/rpmbuild/BUILDROOT/python-dictdiffer-0.9.0-2.fc35.x86_64/...
ERROR dictdiffer/merge.py - _pytest.pathlib.ImportPathMismatchError: ('dictdiffer.merge', '/home/tkloczko/rpmbuild/BUILDROOT/python-dictdiffer-0.9.0-2.fc35.x86_64/usr/li...
ERROR dictdiffer/resolve.py - _pytest.pathlib.ImportPathMismatchError: ('dictdiffer.resolve', '/home/tkloczko/rpmbuild/BUILDROOT/python-dictdiffer-0.9.0-2.fc35.x86_64/us...
ERROR dictdiffer/testing.py - _pytest.pathlib.ImportPathMismatchError: ('dictdiffer.testing', '/home/tkloczko/rpmbuild/BUILDROOT/python-dictdiffer-0.9.0-2.fc35.x86_64/us...
ERROR dictdiffer/unify.py - _pytest.pathlib.ImportPathMismatchError: ('dictdiffer.unify', '/home/tkloczko/rpmbuild/BUILDROOT/python-dictdiffer-0.9.0-2.fc35.x86_64/usr/li...
ERROR dictdiffer/utils.py - _pytest.pathlib.ImportPathMismatchError: ('dictdiffer.utils', '/home/tkloczko/rpmbuild/BUILDROOT/python-dictdiffer-0.9.0-2.fc35.x86_64/usr/li...
ERROR dictdiffer/version.py - _pytest.pathlib.ImportPathMismatchError: ('dictdiffer.version', '/home/tkloczko/rpmbuild/BUILDROOT/python-dictdiffer-0.9.0-2.fc35.x86_64/us...
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 7 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
============================================================================ 7 errors in 0.98s =============================================================================

from dictdiffer.

kloczek avatar kloczek commented on August 15, 2024

Looks like it fails because you don;t know that you should not use python -m pytest which adds to the sys.path upfront current path. Result is thatin your CI pytest is testing source tree and not wehat actually will be used (ehat id prepared in build/lib/dictdiffer/ where there is no modules used by test suite)

from dictdiffer.

kloczek avatar kloczek commented on August 15, 2024

Looks like pytest can be fixed with patch

--- a/pytest.ini~       2021-07-22 14:24:20.000000000 +0100
+++ b/pytest.ini        2021-07-25 10:09:10.019494140 +0100
@@ -7,6 +7,6 @@
 # details.

 [pytest]
-addopts = --isort --pydocstyle --pycodestyle --doctest-glob="*.rst" --doctest-modules --cov=dictdiffer --cov-report=term-missing
+addopts = --doctest-glob="*.rst" --doctest-modules --cov=dictdiffer --cov-report=term-missing tests
 testpaths = tests dictdiffer
 filterwarnings = ignore::pytest.PytestDeprecationWarning

pytest output with that patch:

+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-dictdiffer-0.9.0-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-dictdiffer-0.9.0-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra tests
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.12, pytest-6.2.5, py-1.11.0, pluggy-0.13.1
benchmark: 3.4.1 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10 warmup=False warmup_iterations=100000)
Using --randomly-seed=3172809929
rootdir: /home/tkloczko/rpmbuild/BUILD/dictdiffer-0.9.0, configfile: pytest.ini
plugins: mock-3.6.1, cov-2.12.1, anyio-3.3.4, flaky-3.7.0, console-scripts-1.2.0, asyncio-0.16.0, freezegun-0.4.2, flake8-1.0.7, rerunfailures-9.1.1, yagot-0.5.0, forked-1.4.0, ordering-0.6, xdist-2.5.0, Faker-10.0.0, benchmark-3.4.1, pyfakefs-4.5.3, datadir-1.3.1, regressions-2.2.0, timeout-2.0.2, randomly-3.10.3, perf-0.10.1, trio-0.7.0
collected 88 items

tests/test_dictdiffer.py ..............................................................                                                                              [ 70%]
tests/test_testing.py ..                                                                                                                                             [ 72%]
tests/test_unify.py ..                                                                                                                                               [ 75%]
tests/test_merge.py ...                                                                                                                                              [ 78%]
tests/test_resolve.py ........                                                                                                                                       [ 87%]
tests/test_conflict.py ....                                                                                                                                          [ 92%]
tests/test_utils.py .......                                                                                                                                          [100%]/usr/lib64/python3.8/site-packages/coverage/control.py:768: CoverageWarning: No data was collected. (no-data-collected)
  self._warn("No data was collected.", slug="no-data-collected")


---------- coverage: platform linux, python 3.8.12-final-0 -----------
Name                     Stmts   Miss  Cover   Missing
------------------------------------------------------
dictdiffer/__init__.py     138    138     0%   11-392
dictdiffer/conflict.py      28     28     0%   9-79
dictdiffer/merge.py         42     42     0%   10-142
dictdiffer/resolve.py       51     51     0%   10-152
dictdiffer/testing.py        6      6     0%   8-36
dictdiffer/unify.py         19     19     0%   9-53
dictdiffer/utils.py        110    110     0%   10-281
dictdiffer/version.py        2      2     0%   4-6
------------------------------------------------------
TOTAL                      396    396     0%


============================================================================ 88 passed in 0.87s ============================================================================

Please let me know if you want that patch as PR.

from dictdiffer.

jirikuncar avatar jirikuncar commented on August 15, 2024

Please let me know if you want that patch as PR.

👍 that would be great

from dictdiffer.

jayvdb avatar jayvdb commented on August 15, 2024

This isnt really a bug. It works fine if the pytest plugins in tests_require are installed. see

dictdiffer/setup.py

Lines 21 to 36 in b32e4b0

tests_require = [
'check-manifest>=0.42',
'mock>=1.3.0',
'pytest==5.4.3;python_version<="3.5"',
'pytest>=6;python_version>"3.5"',
'pytest-cov>=2.10.1',
'pytest-isort>=1.2.0',
'pytest-pycodestyle>=2;python_version<="3.5"',
'pytest-pycodestyle>=2.2.0;python_version>"3.5"',
'pytest-pydocstyle>=2;python_version<="3.5"',
'pytest-pydocstyle>=2.2.0;python_version>"3.5"',
'sphinx>=3',
'tox>=3.7.0',
]
extras_require = {

from dictdiffer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.