matplotlib tests fail, expecting their decorator to be outermost
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Đình trệ
- Công nghệ
- python
- Lĩnh vực
- testing-qa, tooling
Hướng nghiên cứu
Tái hiện lỗi bằng appmap-python pytest -vv, sau đó kiểm tra đường dẫn instrumentation trong _appmap/importer.py và _appmap/instrument.py, cùng với các vị trí Matplotlib được nêu: lib/matplotlib/pyplot.py, lib/matplotlib/testing/decorators.py và lib/matplotlib/_api/deprecation.py. Công việc được xem là hoàn tất khi bài kiểm thử Matplotlib đã tái hiện không còn thất bại vì thứ tự decorator hoặc chữ ký được bọc không hợp lệ.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
In the 3.5 version of this project: https://github.com/matplotlib/matplotlib
Revision de98877e3dc45de8dd441d008f23d88738dc015d
Create venv
pip install -r requirements/dev/dev-requirements.txt
pip install -r requirements/testing/all.txt
pip install pytest-xdist pytest appmap
pytest -vv
(most tests will pass)
run appmap-python pytest -vv - all tests will fail.
They all fail with the same error. Here is a single test example.
appmap-python pytest -n8 -vv lib/matplotlib/tests/test_type1font.py::test_Type1Font INT ✘ 3.9.19 matplotlib 17:12:42
=========================================================================================== test session starts ===========================================================================================
platform darwin -- Python 3.9.19, pytest-8.2.1, pluggy-1.5.0 -- /Users/petecheslock/repos/matplotlib/venv/bin/python
cachedir: .pytest_cache
rootdir: /Users/petecheslock/repos/matplotlib
configfile: pytest.ini
plugins: cov-5.0.0, xvfb-3.0.0, rerunfailures-14.0, appmap-2.0.4, timeout-2.3.1, xdist-3.6.1
8 workers [1 item]
scheduling tests via LoadScheduling
lib/matplotlib/tests/test_type1font.py::test_Type1Font
[gw0] [100%] ERROR lib/matplotlib/tests/test_type1font.py::test_Type1Font
================================================================================================= ERRORS ==================================================================================================
____________________________________________________________________________________ ERROR at setup of test_Type1Font _____________________________________________________________________________________
[gw0] darwin -- Python 3.9.19 /Users/petecheslock/repos/matplotlib/venv/bin/python
request = <SubRequest 'mpl_test_settings' for <Function test_Type1Font>>
@pytest.fixture(autouse=True)
def mpl_test_settings(request):
> from matplotlib.testing.decorators import _cleanup_cm
lib/matplotlib/testing/conftest.py:40:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
venv/lib/python3.9/site-packages/_appmap/wrapt/wrappers.py:613: in __call__
return self._self_wrapper(self.__wrapped__, instance,
venv/lib/python3.9/site-packages/_appmap/importer.py:235: in wrapped_exec_module
exec_module(*args, **kwargs)
lib/matplotlib/testing/decorators.py:17: in <module>
from matplotlib import (_api, _pylab_helpers, cbook, ft2font, pyplot as plt,
venv/lib/python3.9/site-packages/_appmap/wrapt/wrappers.py:613: in __call__
return self._self_wrapper(self.__wrapped__, instance,
venv/lib/python3.9/site-packages/_appmap/importer.py:235: in wrapped_exec_module
exec_module(*args, **kwargs)
lib/matplotlib/pyplot.py:2603: in <module>
def imshow(
lib/matplotlib/pyplot.py:105: in _copy_docstring_and_deprecators
func = decorator(func)
venv/lib/python3.9/site-packages/_appmap/wrapt/wrappers.py:622: in __call__
return self._self_wrapper(self.__wrapped__, self._self_instance,
venv/lib/python3.9/site-packages/_appmap/instrument.py:131: in instrumented_fn
return call_instrumented(f, instance, args, kwargs)
venv/lib/python3.9/site-packages/_appmap/instrument.py:82: in call_instrumented
return f.fn(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
since = '3.5', name = 'aspect', func = <function imshow at 0x1537dcca0>
def make_keyword_only(since, name, func=None):
"""
Decorator indicating that passing parameter *name* (or any of the following
ones) positionally to *func* is being deprecated.
When used on a method that has a pyplot wrapper, this should be the
outermost decorator, so that :file:`boilerplate.py` can access the original
signature.
"""
decorator = functools.partial(make_keyword_only, since, name)
if func is None:
return decorator
signature = inspect.signature(func)
POK = inspect.Parameter.POSITIONAL_OR_KEYWORD
KWO = inspect.Parameter.KEYWORD_ONLY
> assert (name in signature.parameters
and signature.parameters[name].kind == POK), (
f"Matplotlib internal error: {name!r} must be a positional-or-keyword "
f"parameter for {func.__name__}()")
E AssertionError: Matplotlib internal error: 'aspect' must be a positional-or-keyword parameter for imshow()
lib/matplotlib/_api/deprecation.py:434: AssertionError
========================================================================================= short test summary info =========================================================================================
ERROR lib/matplotlib/tests/test_type1font.py::test_Type1Font - AssertionError: Matplotlib internal error: 'aspect' must be a positional-or-keyword parameter for imshow()
- Ngôn ngữ chính
- Python
- Star
- 104
- Fork
- 17
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của getappmap/appmap-python
-
getappmap/appmap-python#381 · 1 người được giao ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
getappmap/appmap-python#376 ·
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
getappmap/appmap-python#371 ·
-
enhancement navie-plan
getappmap/appmap-python#366 · 1 bình luận · 1 người được giao ·
-
navie-plan
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
getappmap/appmap-python#365 · 1 bình luận ·
Tất cả issue của getappmap/appmap-python
Issue tương tự
-
fix: inaccuracy ⚠️
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
uabrc/uabrc.github.io#1255 · 1 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
ethereum-optimism/factory#64 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 90/100
duckdb/duckdb-python#627 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
Add link for tutorial Đang mởdocumentation
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 78/100
Qiskit/qiskit-addon-sqd#376 ·