Skip to content

Commit 513ed4c

Browse files
committed
Rename and document the .
1 parent 0af4d2b commit 513ed4c

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

CHANGELOG.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
0.9.8 (unreleased)
33
------------------
44

5-
- Nothing changed yet.
5+
- Add the `pytest.mark.target` marker in the place of `pytest_nodev.search`.
6+
Issue `#28 <https://github.com/nodev-io/pytest-nodev/issues/28>`_.
67

78

89
0.9.7 (2016-03-13)

README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ from the Python Package Index::
4646
$ pip install pytest-nodev
4747

4848
Then copy your specification test to the ``test_parse_bool.py`` file and
49-
decorate it with ``pytest_nodev.search`` as follows::
49+
decorate it with ``pytest.mark.target`` as follows::
5050

51-
@pytest_nodev.search('parse_bool')
51+
@pytest.mark.target('parse_bool')
5252
def test_parse_bool():
5353
assert not parse_bool('false')
5454
assert not parse_bool('FALSE')

pytest_nodev/plugin.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,9 @@ def make_wish_index(config):
115115

116116

117117
def pytest_pycollect_makeitem(collector, name, obj):
118-
search_marker = getattr(obj, 'search', None)
119-
if search_marker and getattr(search_marker, 'args', []):
120-
target_name = search_marker.args[0]
118+
target_marker = getattr(obj, 'target', None)
119+
if target_marker and getattr(target_marker, 'args', []):
120+
target_name = target_marker.args[0]
121121

122122
def wrapper(wish, monkeypatch, *args, **kwargs):
123123
if '.' in target_name:

specs/test_object_from_name.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,18 @@
1-
21
import os
32

43
import pytest
54

65

7-
@pytest.mark.search('object_from_name')
8-
def test_object_from_name_simple():
6+
def test_object_from_name_simple(wish):
7+
object_from_name = wish
98
assert object_from_name('os:O_CREAT') is os.O_CREAT
109
assert object_from_name('os.path:join') is os.path.join
1110
assert object_from_name('builtins:True') is True
1211
assert object_from_name('builtins:open') is open
1312

1413

15-
@pytest.mark.search('object_from_name')
16-
def test_object_from_name_pep3155():
14+
def test_object_from_name_pep3155(wish):
15+
object_from_name = wish
1716
# instance methods compare by equality, see http://stackoverflow.com/questions/15977808
1817
assert object_from_name('os:O_CREAT.bit_length') == os.O_CREAT.bit_length
1918
assert object_from_name('builtins:int.bit_length') is int.bit_length

tests/test_plugin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def test_factorial(wish):
2323
'''
2424
TEST_POW_PY = '''
2525
import pytest
26-
@pytest.mark.search('pow')
26+
@pytest.mark.target('pow')
2727
def test_pow():
2828
assert pow(2, 9, 47) == 42
2929
'''

0 commit comments

Comments
 (0)