Open kloczek opened 3 years ago
Closing. It was buggy pytest extension.
After apply e1a82407 still have one unit failing
+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-pytest-shutil-1.7.0-19.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-pytest-shutil-1.7.0-19.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra -m 'not network'
==================================================================================== test session starts ====================================================================================
platform linux -- Python 3.8.16, pytest-7.3.1, pluggy-1.0.0
rootdir: /home/tkloczko/rpmbuild/BUILD/pytest-plugins-1.7.0/pytest-shutil
configfile: setup.cfg
plugins: shutil-1.7.0, mock-3.10.0, anyio-3.6.2, datadir-1.4.1, regressions-2.4.2, pytest_param_files-0.3.4
collected 56 items
tests/integration/test_cmdline_integration.py .. [ 3%]
tests/integration/test_env_integration.py .... [ 10%]
tests/integration/test_run_integration.py ................x.. [ 44%]
tests/integration/test_workspace_integration.py .. [ 48%]
tests/unit/test_cmdline.py .F.. [ 55%]
tests/unit/test_env.py ....... [ 67%]
tests/unit/test_run.py .......x..xxxxxxxx [100%]
========================================================================================= FAILURES ==========================================================================================
___________________________________________________________________________________ test_pretty_formatter ___________________________________________________________________________________
def test_pretty_formatter():
f = cmdline.PrettyFormatter()
f.title('A Title')
f.hr()
f.p('A Paragraph', 'red')
> assert f.buffer == [
'\x1b[1m\x1b[34m A Title\x1b[0m',
'\x1b[1m\x1b[34m--------------------------------------------------------------------------------\x1b[0m',
'\x1b[31mA Paragraph\x1b[0m'
]
E AssertionError: assert [' A Title',...'A Paragraph'] == ['\x1b[1m\x1b...graph\x1b[0m']
E At index 0 diff: ' A Title' != '\x1b[1m\x1b[34m A Title\x1b[0m'
E Use -v to get more diff
/home/tkloczko/rpmbuild/BUILD/pytest-plugins-1.7.0/pytest-shutil/tests/unit/test_cmdline.py:18: AssertionError
===================================================================================== warnings summary ======================================================================================
../../../BUILDROOT/python-pytest-shutil-1.7.0-19.fc35.x86_64/usr/lib/python3.8/site-packages/pytest_shutil/run.py:6
/home/tkloczko/rpmbuild/BUILDROOT/python-pytest-shutil-1.7.0-19.fc35.x86_64/usr/lib/python3.8/site-packages/pytest_shutil/run.py:6: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
import imp
tests/integration/test_workspace_integration.py::test_workspace_fixture_autodelete
/home/tkloczko/rpmbuild/BUILD/pytest-plugins-1.7.0/pytest-shutil/tests/integration/test_workspace_integration.py:28: PytestWarning: Value of environment variable WORKSPACE type should be str, but got local('/tmp/pytest-of-tkloczko/pytest-32/test_workspace_fixture_autodel0/tmp') (type: LocalPath); converted to str implicitly
monkeypatch.setenv('WORKSPACE', workspace)
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
================================================================================== short test summary info ==================================================================================
XFAIL tests/integration/test_run_integration.py::test_run_in_subprocess_passes_stdout - condition: sys.version_info >= (3, 0, 0)
XFAIL tests/unit/test_run.py::test_run_in_runpickleable_function - python3.5 api changes
XFAIL tests/unit/test_run.py::test_run_in_runbound_method - python3.5 api changes
XFAIL tests/unit/test_run.py::test_run_in_runbound_method_on_unpickleable_class - python3.5 api changes
XFAIL tests/unit/test_run.py::test_run_in_rununbound_method - python3.5 api changes
XFAIL tests/unit/test_run.py::test_run_in_rununbound_method_on_unpickleable_class - python3.5 api changes
XFAIL tests/unit/test_run.py::test_run_in_runstaticmethod - python3.5 api changes
XFAIL tests/unit/test_run.py::test_run_in_runstaticmethod_on_unpickleable_class - python3.5 api changes
XFAIL tests/unit/test_run.py::test_run_in_runclassmethod - python3.5 api changes
XFAIL tests/unit/test_run.py::test_run_in_runclassmethod_on_unpickleable_class - python3.5 api changes
FAILED tests/unit/test_cmdline.py::test_pretty_formatter - AssertionError: assert [' A Title',...'A Paragraph'] == ['\x1b[1m\x1b...graph\x1b[0m']
=================================================================== 1 failed, 45 passed, 10 xfailed, 2 warnings in 3.48s ====================================================================
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:
May I ask for help because few units are failing: