Comments (5)
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.
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.
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.
Please let me know if you want that patch as PR.
👍 that would be great
from dictdiffer.
This isnt really a bug. It works fine if the pytest plugins in tests_require
are installed. see
Lines 21 to 36 in b32e4b0
from dictdiffer.
Related Issues (20)
- For removed items in .patch() first check if exists before deleting HOT 6
- global: migration to github-actions from travis
- Float comparator does not handle inf correctly
- CI: Exclude Python 3.8 with min configuration
- revert(result, patched) - IndexError: list assignment index out of range HOT 2
- Support for diffing and patching data holder objects
- Patch only 'changes' ignore add/remove HOT 1
- version 0.9.0 has dropped PY2 support but is still installable HOT 1
- pytest-runner not required HOT 1
- CI failing due to Sphinx/Jinja mismatch
- ignore_order
- Generate new dict from diff - dict of changes HOT 1
- get wrong result with path_limit
- 'KeyError': index out of bounds on patch.remove
- Toggling remove, add, change when patching HOT 1
- Removing more than two items from a list
- Сomparing large numbers doesn't work HOT 1
- Removing an item from a list causes a cascade of "changes", rather than "removes" HOT 1
- Project abandoned ? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dictdiffer.