Skip to content
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
6 changes: 3 additions & 3 deletions tests/scenario_test/test_get_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@
class TestGetHooks:

def setup_method(self):
cli_args = [get_hooks.__name__, "--protocol", "message-boundaries", "--boundary", ""]
cli_args = [get_hooks.__file__, "--protocol", "message-boundaries", "--boundary", ""]
self.argv_mock = patch.object(sys, "argv", cli_args)
self.argv_mock.start()

def teardown_method(self):
self.argv_mock.stop()

def test_get_manifest(self, capsys):
runpy.run_module(get_hooks.__name__, run_name="__main__")
runpy.run_path(get_hooks.__file__, run_name="__main__")

out, err = capsys.readouterr()
json_response = json.loads(out)
Expand All @@ -26,7 +26,7 @@ def test_get_manifest(self, capsys):
assert get_manifest.__name__ in json_response["hooks"]["get-manifest"]

def test_start(self, capsys):
runpy.run_module(get_hooks.__name__, run_name="__main__")
runpy.run_path(get_hooks.__file__, run_name="__main__")

out, err = capsys.readouterr()
json_response = json.loads(out)
Expand Down
6 changes: 3 additions & 3 deletions tests/scenario_test/test_get_manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
class TestGetManifest:

def setup_method(self):
cli_args = [get_manifest.__name__, "--protocol", "message-boundaries", "--boundary", ""]
cli_args = [get_manifest.__file__, "--protocol", "message-boundaries", "--boundary", ""]
self.argv_mock = patch.object(sys, "argv", cli_args)
self.argv_mock.start()
self.cwd = os.getcwd()
Expand All @@ -26,7 +26,7 @@ def test_get_manifest_script(self, capsys):
working_directory = "tests/scenario_test/test_app"
os.chdir(working_directory)

runpy.run_module(get_manifest.__name__, run_name="__main__")
runpy.run_path(get_manifest.__file__, run_name="__main__")

out, err = capsys.readouterr()
assert err == ""
Expand All @@ -37,6 +37,6 @@ def test_get_manifest_script_no_manifest(self):
os.chdir(working_directory)

with pytest.raises(CliError) as e:
runpy.run_module(get_manifest.__name__, run_name="__main__")
runpy.run_path(get_manifest.__file__, run_name="__main__")

assert str(e.value) == "Could not find a manifest.json file"
8 changes: 4 additions & 4 deletions tests/scenario_test/test_start.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def setup_method(self):
setup_mock_web_api_server(self)
start_socket_mode_server(self, 3012)

cli_args = [start.__name__, "--protocol", "message-boundaries", "--boundary", ""]
cli_args = [start.__file__, "--protocol", "message-boundaries", "--boundary", ""]
self.argv_mock = patch.object(sys, "argv", cli_args)
self.argv_mock.start()

Expand All @@ -41,7 +41,7 @@ def teardown_method(self):
def test_start_script(self, capsys, caplog):
os.chdir(self.working_directory)

runpy.run_module(start.__name__, run_name="__main__")
runpy.run_path(start.__file__, run_name="__main__")

captured_sys = capsys.readouterr()

Expand All @@ -52,7 +52,7 @@ def test_start_with_entrypoint(self, capsys, caplog):
os.environ["SLACK_APP_PATH"] = "my_app.py"
os.chdir(self.working_directory)

runpy.run_module(start.__name__, run_name="__main__")
runpy.run_path(start.__file__, run_name="__main__")

captured_sys = capsys.readouterr()

Expand All @@ -64,6 +64,6 @@ def test_start_no_entrypoint(self):
os.chdir(working_directory)

with pytest.raises(CliError) as e:
runpy.run_module(start.__name__, run_name="__main__")
runpy.run_path(start.__file__, run_name="__main__")

assert "Could not find app.py file" in str(e.value)