alexmojaki / executing

Get information about what a Python frame is currently doing, particularly the AST node being executed
MIT License
330 stars 32 forks source link

2.0.0: pytest is failing in `tests/test_ipython.py::test_two_statement_lookups` unit #76

Closed kloczek closed 1 year ago

kloczek commented 1 year ago

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.

Here is pytest output:

```console + PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-executing-2.0.0-3.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-executing-2.0.0-3.fc35.x86_64/usr/lib/python3.8/site-packages + /usr/bin/pytest -ra -m 'not network' ============================= test session starts ============================== platform linux -- Python 3.8.18, pytest-7.4.3, pluggy-1.3.0 rootdir: /home/tkloczko/rpmbuild/BUILD/executing-2.0.0 collected 198 items tests/test_ipython.py .F [ 1%] tests/test_main.py ..................................................x.. [ 27%] ..............x....x....x............................................... [ 64%] ........................................x..xsssssssssssssss. [ 94%] tests/test_pytest.py ........... [100%] =================================== FAILURES =================================== __________________________ test_two_statement_lookups __________________________ def test_two_statement_lookups(): p = run(test_function_code + "test();test()") > assert "test failure" in p E AssertionError: assert 'test failure' in '' tests/test_ipython.py:41: AssertionError ----------------------------- Captured stdout call ----------------------------- ----------------------------- Captured stderr call ----------------------------- /usr/bin/python3: No module named IPython =========================== short test summary info ============================ SKIPPED [14] tests/test_main.py:754: These tests are very slow, enable them explicitly SKIPPED [1] tests/test_main.py:770: These tests are very slow, enable them explicitly XFAIL tests/test_main.py::test_small_samples[206e0609ff0589a0a32422ee902f09156af91746e27157c32c9595d12072f92a.py] - reason: SentinelNodeFinder does not find some of the nodes (maybe a bug) XFAIL tests/test_main.py::test_small_samples[42a37b8a823eb2e510b967332661afd679c82c60b7177b992a47c16d81117c8a.py] - reason: SentinelNodeFinder does not find some of the nodes (maybe a bug) XFAIL tests/test_main.py::test_small_samples[4851dc1b626a95e97dbe0c53f96099d165b755dd1bd552c6ca771f7bca6d30f5.py] - reason: SentinelNodeFinder does not find some of the nodes (maybe a bug) XFAIL tests/test_main.py::test_small_samples[508ccd0dcac13ecee6f0cea939b73ba5319c780ddbb6c496be96fe5614871d4a.py] - reason: SentinelNodeFinder does not find some of the nodes (maybe a bug) XFAIL tests/test_main.py::test_small_samples[fc6eb521024986baa84af2634f638e40af090be4aa70ab3c22f3d022e8068228.py] - reason: SentinelNodeFinder does not find some of the nodes (maybe a bug) XFAIL tests/test_main.py::test_small_samples[load_deref.py] - reason: SentinelNodeFinder does not find some of the nodes (maybe a bug) FAILED tests/test_ipython.py::test_two_statement_lookups - AssertionError: as... ============ 1 failed, 176 passed, 15 skipped, 6 xfailed in 22.52s ============= /usr/lib/python3.8/site-packages/_pytest/pathlib.py:95: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-de886006-989d-4184-bc6d-b571bc244097/test_rmtree_errorhandler_rerai0 : [Errno 39] Directory not empty: 'test_rmtree_errorhandler_rerai0' warnings.warn( /usr/lib/python3.8/site-packages/_pytest/pathlib.py:95: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-de886006-989d-4184-bc6d-b571bc244097/test_rmtree_errorhandler_reado0 : [Errno 39] Directory not empty: 'test_rmtree_errorhandler_reado0' warnings.warn( /usr/lib/python3.8/site-packages/_pytest/pathlib.py:95: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-de886006-989d-4184-bc6d-b571bc244097/test_safe_delete_no_perms0 : [Errno 39] Directory not empty: 'test_safe_delete_no_perms0' warnings.warn( /usr/lib/python3.8/site-packages/_pytest/pathlib.py:95: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-de886006-989d-4184-bc6d-b571bc244097/test_safe_set_no_perms0 : [Errno 39] Directory not empty: 'test_safe_set_no_perms0' warnings.warn( /usr/lib/python3.8/site-packages/_pytest/pathlib.py:95: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-de886006-989d-4184-bc6d-b571bc244097/test_safe_get_no_perms0 : [Errno 39] Directory not empty: 'test_safe_get_no_perms0' warnings.warn( /usr/lib/python3.8/site-packages/_pytest/pathlib.py:95: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-de886006-989d-4184-bc6d-b571bc244097 : [Errno 39] Directory not empty: '/tmp/pytest-of-tkloczko/garbage-de886006-989d-4184-bc6d-b571bc244097' warnings.warn( /usr/lib/python3.8/site-packages/_pytest/pathlib.py:95: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-07863f54-4301-46f4-b0f5-ae75827ff0eb/test_rmtree_errorhandler_rerai0 : [Errno 39] Directory not empty: 'test_rmtree_errorhandler_rerai0' warnings.warn( /usr/lib/python3.8/site-packages/_pytest/pathlib.py:95: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-07863f54-4301-46f4-b0f5-ae75827ff0eb/test_rmtree_errorhandler_reado0 : [Errno 39] Directory not empty: 'test_rmtree_errorhandler_reado0' warnings.warn( /usr/lib/python3.8/site-packages/_pytest/pathlib.py:95: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-07863f54-4301-46f4-b0f5-ae75827ff0eb/test_safe_delete_no_perms0 : [Errno 39] Directory not empty: 'test_safe_delete_no_perms0' warnings.warn( /usr/lib/python3.8/site-packages/_pytest/pathlib.py:95: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-07863f54-4301-46f4-b0f5-ae75827ff0eb/test_safe_set_no_perms0 : [Errno 39] Directory not empty: 'test_safe_set_no_perms0' warnings.warn( /usr/lib/python3.8/site-packages/_pytest/pathlib.py:95: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-07863f54-4301-46f4-b0f5-ae75827ff0eb/test_safe_get_no_perms0 : [Errno 39] Directory not empty: 'test_safe_get_no_perms0' warnings.warn( /usr/lib/python3.8/site-packages/_pytest/pathlib.py:95: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-07863f54-4301-46f4-b0f5-ae75827ff0eb : [Errno 39] Directory not empty: '/tmp/pytest-of-tkloczko/garbage-07863f54-4301-46f4-b0f5-ae75827ff0eb' warnings.warn( ```

Here is list of installed modules in build env

```console Package Version ----------------------------- ------- alabaster 0.7.13 asttokens 2.2.1 Babel 2.13.1 build 1.0.0 charset-normalizer 3.3.1 cppclean 0.13 distro 1.8.0 docutils 0.20.1 exceptiongroup 1.1.3 gpg 1.22.0 idna 3.4 imagesize 1.4.1 importlib-metadata 6.8.0 iniconfig 2.0.0 installer 0.7.0 Jinja2 3.1.2 MarkupSafe 2.1.3 packaging 23.2 pluggy 1.3.0 Pygments 2.16.1 pyproject_hooks 1.0.0 pytest 7.4.3 python-dateutil 2.8.2 pytz 2023.3 requests 2.31.0 setuptools 68.2.2 setuptools-scm 8.0.4 six 1.16.0 snowballstemmer 2.2.0 Sphinx 7.1.2 sphinxcontrib-applehelp 1.0.4 sphinxcontrib-devhelp 1.0.2 sphinxcontrib-htmlhelp 2.0.4 sphinxcontrib-jsmath 1.0.1 sphinxcontrib-qthelp 1.0.3 sphinxcontrib-serializinghtml 1.1.9 tomli 2.0.1 typing_extensions 4.8.0 urllib3 1.26.18 wheel 0.41.2 zipp 3.17.0 ```
alexmojaki commented 1 year ago

This is simply about IPython not being installed in your env.

kloczek commented 1 year ago

One sec .. let me check 😋

kloczek commented 1 year ago

Indeed it was missing ipyhon. Thank you very much 👍 😄

+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-executing-1.2.0-5.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-executing-1.2.0-5.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra -m 'not network'
==================================================================================== test session starts ====================================================================================
platform linux -- Python 3.8.18, pytest-7.4.3, pluggy-1.3.0
rootdir: /home/tkloczko/rpmbuild/BUILD/executing-1.2.0
collected 59 items

tests/test_main.py ................................sssssssssssssss.                                                                                                                   [ 81%]
tests/test_pytest.py ...........                                                                                                                                                      [100%]

================================================================================== short test summary info ==================================================================================
SKIPPED [14] tests/test_main.py:680: These tests are very slow, enable them explicitly
SKIPPED [1] tests/test_main.py:696: These tests are very slow, enable them explicitly
============================================================================== 44 passed, 15 skipped in 13.04s ==============================================================================