Skip to content

Commit

Permalink
Rework a bit this test.
Browse files Browse the repository at this point in the history
  • Loading branch information
ionelmc committed May 2, 2024
1 parent 682617c commit 1a8a84d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
10 changes: 7 additions & 3 deletions tests/sample5.pyx
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
# cython: linetrace=True, language_level=3
foo = bar = lambda x: x
a = b = lambda x: x


@foo
@bar
@a
@b
def foo():
return 1


def bar():
foo()
6 changes: 3 additions & 3 deletions tests/test_tracer.py
Original file line number Diff line number Diff line change
Expand Up @@ -849,15 +849,15 @@ def foo():
def test_source_cython(LineMatcher):
pytest.importorskip('sample5')
calls = []
from sample5 import foo
from sample5 import bar

with trace(action=lambda event: calls.extend(event.source.splitlines())):
foo()
bar()

lm = LineMatcher(calls)
lm.fnmatch_lines(
[
'def foo():',
'def bar():',
' return 1',
]
)
Expand Down
5 changes: 3 additions & 2 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ deps =
pytest
pytest-benchmark
cover: pytest-cov
{cython,cover}: cython==3.0.10
{py38,py39,py310,py311,py312}: cython==3.0.10
manhole
process-tests
setuptools-scm
Expand All @@ -52,7 +52,8 @@ deps =
tzdata
ipdb
commands =
{py38,py39,py310,py311,py312}: python tests/setup.py clean --all build_ext --force --inplace
{py38,py39,py310,py311,py312}: python tests/setup.py clean --all
{py38,py39,py310,py311,py312}: python tests/setup.py build_ext --force --inplace
cover: python setup.py clean --all build_ext --force --inplace
nocov: {posargs:pytest -vv --ignore=src}
cover: {posargs:pytest --cov --cov-report=term-missing -vv}
Expand Down

0 comments on commit 1a8a84d

Please sign in to comment.