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

Rename test that were never ran. #302

Merged
merged 1 commit into from
Feb 13, 2024
Merged
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
27 changes: 20 additions & 7 deletions tests/test_autoimp.py
Original file line number Diff line number Diff line change
Expand Up @@ -1715,13 +1715,19 @@ def test_load_symbol_missing_2():
load_symbol("os.path.join", {})


def load_symbol_eval_1():
@pytest.mark.xfail(
strict=True, reason="old test that was not names with test_ and never passed"
)
def test_load_symbol_eval_1():
assert 'a/b' == load_symbol("os.path.join('a','b')", {"os": os})
assert '/' == load_symbol("os.path.join('a','b')[1]", {"os": os})
assert 'A' == load_symbol("os.path.join('a','b')[0].upper()", {"os": os})


def load_symbol_eval_2(capsys):
@pytest.mark.xfail(
strict=True, reason="old test that was not names with test_ and never passed"
)
def test_load_symbol_eval_2(capsys):
assert '/' == load_symbol("(os.path.sep[0])", {}, autoimport=True,
allow_eval=True)
out, _ = capsys.readouterr()
Expand All @@ -1731,7 +1737,7 @@ def load_symbol_eval_2(capsys):
assert expected == out


def load_symbol_no_eval_1():
def test_load_symbol_no_eval_1():
with pytest.raises(LoadSymbolError):
load_symbol("os.path.join('a','b')", {"os": os})
with pytest.raises(LoadSymbolError):
Expand All @@ -1740,7 +1746,7 @@ def load_symbol_no_eval_1():
load_symbol("os.path.join('a','b')[0].upper", {"os": os})


def load_symbol_wrap_exc_1():
def test_load_symbol_wrap_exc_1():
class Foo89503828(object):
def __getattr__(self, k):
1/0
Expand All @@ -1753,9 +1759,13 @@ def __getattr__(self, k):
assert False


def load_symbol_wrap_exc_eval_1():
@pytest.mark.xfail(
strict=True, reason="old test that was not names with test_ and never passed"
)
def test_load_symbol_wrap_exc_eval_1():
def foo31617859():
1/0
return 1 / 0

ns = [{"foo": foo31617859()}]
try:
load_symbol("foo()", ns, auto_eval=True)
Expand All @@ -1765,7 +1775,10 @@ def foo31617859():
assert False


def load_symbol_wrap_exc_eval_getattr_1():
@pytest.mark.xfail(
strict=True, reason="old test that was not names with test_ and never passed"
)
def test_load_symbol_wrap_exc_eval_getattr_1():
class Foo15356301(object):
def __getattr__(self, k):
1/0
Expand Down
Loading