Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,11 @@ source = src/
*/lib/python*/site-packages/
*/pypy*/site-packages/
*\Lib\site-packages\

[report]
skip_covered = True
show_missing = True
exclude_lines =
\#\s*pragma: no cover
^\s*raise NotImplementedError\b
^\s*return NotImplemented\b
20 changes: 10 additions & 10 deletions testing/python/fixtures.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,22 @@ def test_getfuncargnames_functions():
"""Test getfuncargnames for normal functions"""

def f():
pass
raise NotImplementedError()

assert not fixtures.getfuncargnames(f)

def g(arg):
pass
raise NotImplementedError()

assert fixtures.getfuncargnames(g) == ("arg",)

def h(arg1, arg2="hello"):
pass
raise NotImplementedError()

assert fixtures.getfuncargnames(h) == ("arg1",)

def j(arg1, arg2, arg3="hello"):
pass
raise NotImplementedError()

assert fixtures.getfuncargnames(j) == ("arg1", "arg2")

Expand All @@ -39,7 +39,7 @@ def test_getfuncargnames_methods():

class A:
def f(self, arg1, arg2="hello"):
pass
raise NotImplementedError()

assert fixtures.getfuncargnames(A().f) == ("arg1",)

Expand All @@ -50,7 +50,7 @@ def test_getfuncargnames_staticmethod():
class A:
@staticmethod
def static(arg1, arg2, x=1):
pass
raise NotImplementedError()

assert fixtures.getfuncargnames(A.static, cls=A) == ("arg1", "arg2")

Expand All @@ -60,7 +60,7 @@ def test_getfuncargnames_partial():
import functools

def check(arg1, arg2, i):
pass
raise NotImplementedError()

class T:
test_ok = functools.partial(check, i=2)
Expand All @@ -74,7 +74,7 @@ def test_getfuncargnames_staticmethod_partial():
import functools

def check(arg1, arg2, i):
pass
raise NotImplementedError()

class T:
test_ok = staticmethod(functools.partial(check, i=2))
Expand Down Expand Up @@ -3355,7 +3355,7 @@ def test_fixture_disallow_twice(self):
@pytest.fixture
@pytest.fixture
def foo():
pass
raise NotImplementedError()


class TestContextManagerFixtureFuncs:
Expand Down Expand Up @@ -3981,7 +3981,7 @@ def test_call_fixture_function_error():

@pytest.fixture
def fix():
return 1
raise NotImplementedError()

with pytest.raises(pytest.fail.Exception):
assert fix() == 1
Expand Down