Skip to content

Commit

Permalink
fix/adjust tests, XXX: messed up revert?
Browse files Browse the repository at this point in the history
  • Loading branch information
blueyed committed Oct 15, 2020
1 parent c06b8ef commit 05e92db
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion testing/python/collect.py
Original file line number Diff line number Diff line change
Expand Up @@ -1081,7 +1081,7 @@ def reportinfo(self):
return "ABCDE", 42, "custom"
def pytest_pycollect_makeitem(collector, name, obj):
if name == "test_func":
return MyFunction.from_parent(name=name, parent=collector)
return MyFunction(name, parent=collector)
"""
)
item = testdir.getitem("def test_func(): pass")
Expand Down
8 changes: 4 additions & 4 deletions testing/test_nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ def test_ischildnode(baseid, nodeid, expected):
assert result is expected


def test_node_from_parent_disallowed_arguments():
def test_node_from_parent_disallowed_arguments() -> None:
with pytest.raises(TypeError, match="session is"):
nodes.Node.from_parent(None, session=None)
nodes.Node.from_parent(None, session=None) # type: ignore[arg-type]
with pytest.raises(TypeError, match="config is"):
nodes.Node.from_parent(None, config=None)
nodes.Node.from_parent(None, config=None) # type: ignore[arg-type]


def test_std_warn_not_pytestwarning(testdir):
Expand Down Expand Up @@ -66,7 +66,7 @@ def runtest(self):
assert 0, "failure"
def pytest_collect_file(path, parent):
return MyItem.from_parent(parent, name="foo")
return MyItem("foo", parent)
"""
)

Expand Down
2 changes: 1 addition & 1 deletion testing/test_pytester.py
Original file line number Diff line number Diff line change
Expand Up @@ -1230,7 +1230,7 @@ def runtest(self):
pytest.fail("failure")
def pytest_collect_file(path, parent):
return MyItem.from_parent(parent, name="fooitem")
return MyItem("fooitem", parent)
"""
)
result = testdir.runpytest("-p", "pytester", str(p1))
Expand Down

0 comments on commit 05e92db

Please sign in to comment.