Skip to content

Commit 6ead01a

Browse files
committed
testing/python/fixtures.py: use NotImplementedError pattern
1 parent 4c37dca commit 6ead01a

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

testing/python/fixtures.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,22 @@ def test_getfuncargnames_functions():
1414
"""Test getfuncargnames for normal functions"""
1515

1616
def f():
17-
pass
17+
raise NotImplementedError()
1818

1919
assert not fixtures.getfuncargnames(f)
2020

2121
def g(arg):
22-
pass
22+
raise NotImplementedError()
2323

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

2626
def h(arg1, arg2="hello"):
27-
pass
27+
raise NotImplementedError()
2828

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

3131
def j(arg1, arg2, arg3="hello"):
32-
pass
32+
raise NotImplementedError()
3333

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

@@ -39,7 +39,7 @@ def test_getfuncargnames_methods():
3939

4040
class A:
4141
def f(self, arg1, arg2="hello"):
42-
pass
42+
raise NotImplementedError()
4343

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

@@ -50,7 +50,7 @@ def test_getfuncargnames_staticmethod():
5050
class A:
5151
@staticmethod
5252
def static(arg1, arg2, x=1):
53-
pass
53+
raise NotImplementedError()
5454

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

@@ -60,7 +60,7 @@ def test_getfuncargnames_partial():
6060
import functools
6161

6262
def check(arg1, arg2, i):
63-
pass
63+
raise NotImplementedError()
6464

6565
class T:
6666
test_ok = functools.partial(check, i=2)
@@ -74,7 +74,7 @@ def test_getfuncargnames_staticmethod_partial():
7474
import functools
7575

7676
def check(arg1, arg2, i):
77-
pass
77+
raise NotImplementedError()
7878

7979
class T:
8080
test_ok = staticmethod(functools.partial(check, i=2))
@@ -3355,7 +3355,7 @@ def test_fixture_disallow_twice(self):
33553355
@pytest.fixture
33563356
@pytest.fixture
33573357
def foo():
3358-
pass
3358+
raise NotImplementedError()
33593359

33603360

33613361
class TestContextManagerFixtureFuncs:
@@ -3981,7 +3981,7 @@ def test_call_fixture_function_error():
39813981

39823982
@pytest.fixture
39833983
def fix():
3984-
return 1
3984+
raise NotImplementedError()
39853985

39863986
with pytest.raises(pytest.fail.Exception):
39873987
assert fix() == 1

0 commit comments

Comments
 (0)