Skip to content

Commit

Permalink
Workaround tests that fail because they violate type annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
gschaffner committed Jul 12, 2022
1 parent 0479dda commit 6ac01a9
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/test__parametrize.py
Expand Up @@ -169,6 +169,7 @@ def test_generate_calls_simple():

f = mock.Mock()
f.__name__ = "f"
f.requires = None
f.some_prop = 42

arg_names = ("abc",)
Expand Down Expand Up @@ -202,6 +203,7 @@ def test_generate_calls_multiple_args():

f = mock.Mock()
f.__name__ = "f"
f.requires = None

arg_names = ("foo", "abc")
call_specs = [
Expand All @@ -228,6 +230,7 @@ def test_generate_calls_multiple_args():
def test_generate_calls_ids():
f = mock.Mock()
f.__name__ = "f"
f.requires = None

arg_names = ("foo",)
call_specs = [
Expand Down
6 changes: 6 additions & 0 deletions tests/test_sessions.py
Expand Up @@ -782,6 +782,7 @@ def make_runner(self):
func.python = None
func.venv_backend = None
func.reuse_venv = False
func.requires = []
runner = nox.sessions.SessionRunner(
name="test",
signatures=["test(1, 2)"],
Expand Down Expand Up @@ -919,6 +920,7 @@ def test_execute_quit(self):
def func(session):
session.error("meep")

func.requires = []
runner.func = func

result = runner.execute()
Expand All @@ -931,6 +933,7 @@ def test_execute_skip(self):
def func(session):
session.skip("meep")

func.requires = []
runner.func = func

result = runner.execute()
Expand Down Expand Up @@ -988,6 +991,7 @@ def test_execute_failed(self):
def func(session):
raise nox.command.CommandFailed()

func.requires = []
runner.func = func

result = runner.execute()
Expand All @@ -1000,6 +1004,7 @@ def test_execute_interrupted(self):
def func(session):
raise KeyboardInterrupt()

func.requires = []
runner.func = func

with pytest.raises(KeyboardInterrupt):
Expand All @@ -1011,6 +1016,7 @@ def test_execute_exception(self):
def func(session):
raise ValueError("meep")

func.requires = []
runner.func = func

result = runner.execute()
Expand Down
2 changes: 2 additions & 0 deletions tests/test_tasks.py
Expand Up @@ -40,6 +40,7 @@ def session_func():
session_func.venv_backend = None
session_func.should_warn = dict()
session_func.tags = []
session_func.requires = []


def session_func_with_python():
Expand All @@ -48,6 +49,7 @@ def session_func_with_python():

session_func_with_python.python = "3.8"
session_func_with_python.venv_backend = None
session_func_with_python.requires = []


def session_func_venv_pythons_warning():
Expand Down

0 comments on commit 6ac01a9

Please sign in to comment.