Repository navigation
Open
Description
I'm trying to package your module as rpm packag. So I'm using typical in such case build, install and test cycle used on building package from non-root account:
- "setup.py build"
- "setup.py install --root </install/prefix>"
- "pytest with PYTHONPATH pointing to sitearch and sitelib inside </install/prefix>
May I ask for help because few units are failing:
+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-multipledispatch-0.6.0-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-multipledispatch-0.6.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=1915887508
rootdir: /home/tkloczko/rpmbuild/BUILD/multipledispatch-0.6.0
plugins: forked-1.3.0, shutil-1.7.0, virtualenv-1.7.0, expect-1.1.0, flake8-1.0.7, timeout-1.4.2, betamax-0.8.1, freezegun-0.4.2, aspectlib-1.5.2, toolbox-0.5, rerunfailures-9.1.1, requests-mock-1.9.3, cov-2.12.1, pyfakefs-4.5.0, flaky-3.7.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, xprocess-0.18.1, black-0.3.12, checkdocs-2.7.1, anyio-3.3.0, Faker-8.11.0, asyncio-0.15.1, trio-0.7.0, httpbin-1.0.0, subtests-0.5.0, isort-2.0.0, hypothesis-6.14.6, mock-3.6.1, profiling-1.7.0, randomly-3.8.0
collected 63 items
multipledispatch/tests/test_dispatcher_3only.py ...... [ 9%]
multipledispatch/tests/test_variadic.py ... [ 14%]
multipledispatch/tests/test_dispatcher.py ........................... [ 57%]
. . [ 58%]
bench/test_simple.py . [ 60%]
multipledispatch/tests/test_benchmark.py .... [ 66%]
multipledispatch/tests/test_core.py ......F..... [ 85%]
multipledispatch/tests/test_conflict.py ......... [100%]
================================================================================= FAILURES =================================================================================
__________________________________________________________________ test_inheritance_and_multiple_dispatch __________________________________________________________________
def test_inheritance_and_multiple_dispatch():
@dispatch(A, A)
def f(x, y):
return type(x), type(y)
@dispatch(A, B)
def f(x, y):
return 0
assert f(A(), A()) == (A, A)
> assert f(A(), C()) == (A, C)
E AssertionError: assert 2 == (<class 'test_core.A'>, <class 'test_core.C'>)
E + where 2 = <dispatched f>(<test_core.A object at 0x7facfa290d90>, <test_core.C object at 0x7facfa290f10>)
E + where <test_core.A object at 0x7facfa290d90> = A()
E + and <test_core.C object at 0x7facfa290f10> = C()
multipledispatch/tests/test_core.py:75: AssertionError
============================================================================= warnings summary =============================================================================
multipledispatch/tests/test_core.py::test_multipledispatch
multipledispatch/tests/test_core.py:31: PytestBenchmarkWarning: Benchmark fixture was not used at all in this test!
def test_multipledispatch(benchmark):
-- Docs: https://docs.pytest.org/en/stable/warnings.html
---------------------------------------------------------------------------------------------------------------- benchmark: 4 tests ----------------------------------------------------------------------------------------------------------------
Name (time in ns) Min Max Mean StdDev Median IQR Outliers OPS (Kops/s) Rounds Iterations
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
test_benchmark_call_single_dispatch[a] 814.8296 (1.0) 102,342.3392 (16.94) 858.7401 (1.0) 259.4712 (2.58) 837.3366 (1.0) 30.6754 (1.09) 1150;13768 1,164.4966 (1.0) 177934 6
test_benchmark_call_single_dispatch[1] 832.2531 (1.02) 6,042.7701 (1.0) 878.3960 (1.02) 100.4279 (1.0) 869.7389 (1.04) 28.2598 (1.0) 545;6426 1,138.4387 (0.98) 98348 4
test_benchmark_call_multiple_dispatch[val0] 1,088.0176 (1.34) 17,664.0460 (2.92) 1,263.0155 (1.47) 678.5140 (6.76) 1,157.9832 (1.38) 35.9723 (1.27) 1040;3729 791.7559 (0.68) 43186 1
test_benchmark_add_and_use_instance 246,200.0120 (302.15) 2,871,196.0185 (475.15) 263,512.1736 (306.86) 64,891.5833 (646.15) 256,208.0044 (305.98) 12,248.9291 (433.44) 27;81 3.7949 (0.00) 1829 1
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Legend:
Outliers: 1 Standard Deviation from Mean; 1.5 IQR (InterQuartile Range) from 1st Quartile and 3rd Quartile.
OPS: Operations Per Second, computed as 1 / Mean
========================================================================= short test summary info ==========================================================================
FAILED multipledispatch/tests/test_core.py::test_inheritance_and_multiple_dispatch - AssertionError: assert 2 == (<class 'test_core.A'>, <class 'test_core.C'>)
================================================================= 1 failed, 62 passed, 1 warning in 12.08s =================================================================
pytest-xprocess reminder::Be sure to terminate the started process by running 'pytest --xkill' if you have not explicitly done so in your fixture with 'xprocess.getinfo(<process_name>).terminate()'.Metadata
Metadata
Assignees
Labels
No labels
Activity
kloczek commentedon Aug 22, 2021
Strange after deselecting that failing unit another one popped out
kloczek commentedon Aug 22, 2021
No this is completly different issue.
I have installed
pytest-randomlyand this extension executes pytest units in random order.Adfter add
-p no:randomlyto pytest parameters everything is file.Still it is some test suite issue because looks like there are some dependencies betweeen units.
Those issueas can be resolved using https://github.com/mrbean-bremen/pytest-find-dependencies/