Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove invalid expectation for warnings in some tests. #1094

Merged
merged 2 commits into from
Mar 1, 2024
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
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ dependencies = [
dynamic = ["version"]

[project.optional-dependencies]
test_minimal = ["pytest", "coverage", "pytest-cov"]
test_minimal = ["pytest>=8", "coverage", "pytest-cov"]
test = ["pytest", "ipython", "numpy", "pandas>=1.3.5"]
numpy = []
pandas = ["numpy", "pandas>=1.3.5"]
Expand Down
3 changes: 1 addition & 2 deletions rpy2/tests/rinterface/test_callbacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,8 +266,7 @@ def f(prompt):
utils.noconsole):
with utils.obj_in_module(callbacks, 'choosefile', f):
with pytest.raises(rinterface.embedded.RRuntimeError):
with pytest.warns(rinterface.RRuntimeWarning):
rinterface.baseenv["file.choose"]()
rinterface.baseenv["file.choose"]()


def test_showfiles_default(capsys):
Expand Down
3 changes: 1 addition & 2 deletions rpy2/tests/rinterface/test_environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,7 @@ def test_subscript_utf8():

def test_subscript_missing_utf8():
env = rinterface.baseenv['new.env']()
with pytest.raises(KeyError),\
pytest.warns(rinterface.RRuntimeWarning):
with pytest.raises(KeyError):
env['呵呵']


Expand Down
9 changes: 3 additions & 6 deletions rpy2/tests/rinterface/test_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,7 @@ def test_typeof():
def test_r_error():
r_sum = rinterface.baseenv['sum']
letters = rinterface.baseenv['letters']
with pytest.raises(rinterface.embedded.RRuntimeError),\
pytest.warns(rinterface.RRuntimeWarning):
with pytest.raises(rinterface.embedded.RRuntimeError):
r_sum(letters)


Expand Down Expand Up @@ -77,8 +76,7 @@ def test_closureenv():
assert isinstance(fun.closureenv, rinterface.SexpEnvironment)

with pytest.raises(rinterface.embedded.RRuntimeError):
with pytest.warns(rinterface.RRuntimeWarning):
fun(vec)
fun(vec)

fun.closureenv['y'] = (rinterface
.IntSexpVector([1, ]))
Expand Down Expand Up @@ -132,8 +130,7 @@ def test_call_OrdDictEnv():
def test_error_in_call():
r_sum = rinterface.baseenv['sum']

with pytest.raises(rinterface.embedded.RRuntimeError),\
pytest.warns(rinterface.RRuntimeWarning):
with pytest.raises(rinterface.embedded.RRuntimeError):
r_sum(2, 'a')


Expand Down
3 changes: 1 addition & 2 deletions rpy2/tests/robjects/test_packages.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,7 @@ def test_import_stats_with_libloc_and_suppressmessages(self):
def test_import_stats_with_libloc_with_quote(self):
path = 'coin"coin'

with pytest.raises(robjects.packages.PackageNotInstalledError), \
pytest.warns(UserWarning):
with pytest.raises(robjects.packages.PackageNotInstalledError):
Tmp_File = io.StringIO
tmp_file = Tmp_File()
try:
Expand Down
Loading