@@ -23,16 +23,16 @@ def test_detect_env_with_buildkite_api_env_vars_returns_the_correct_environment(
2323 "BUILDKITE_MESSAGE" : "All we are is dust in the wind, dude." ,
2424 }
2525 with mock .patch .dict (os .environ , env , clear = True ):
26- runtime_env = detect_env ()
26+ run_env = detect_env ()
2727
28- assert runtime_env .ci == "buildkite"
29- assert runtime_env .key == id
30- assert runtime_env .url == "https://example.test/buildkite"
31- assert runtime_env .branch == "rufus"
32- assert runtime_env .commit_sha == commit
33- assert runtime_env .number == number
34- assert runtime_env .job_id == job_id
35- assert runtime_env .message == "All we are is dust in the wind, dude."
28+ assert run_env .ci == "buildkite"
29+ assert run_env .key == id
30+ assert run_env .url == "https://example.test/buildkite"
31+ assert run_env .branch == "rufus"
32+ assert run_env .commit_sha == commit
33+ assert run_env .number == number
34+ assert run_env .job_id == job_id
35+ assert run_env .message == "All we are is dust in the wind, dude."
3636
3737
3838def test_detect_env_with_github_actions_env_vars_returns_the_correct_environment ():
@@ -53,16 +53,16 @@ def test_detect_env_with_github_actions_env_vars_returns_the_correct_environment
5353 }
5454
5555 with mock .patch .dict (os .environ , env , clear = True ):
56- runtime_env = detect_env ()
56+ run_env = detect_env ()
5757
58- assert runtime_env .ci == "github_actions"
59- assert runtime_env .key == f"bring-about-world-peace-{ run_number } -{ run_attempt } "
60- assert runtime_env .url == f"https://github.com/bill-and-ted/phone-booth/actions/runs/{ run_id } "
61- assert runtime_env .branch == "rufus"
62- assert runtime_env .commit_sha == commit
63- assert runtime_env .number == run_number
64- assert runtime_env .job_id is None
65- assert runtime_env .message == "excellent adventure"
58+ assert run_env .ci == "github_actions"
59+ assert run_env .key == f"bring-about-world-peace-{ run_number } -{ run_attempt } "
60+ assert run_env .url == f"https://github.com/bill-and-ted/phone-booth/actions/runs/{ run_id } "
61+ assert run_env .branch == "rufus"
62+ assert run_env .commit_sha == commit
63+ assert run_env .number == run_number
64+ assert run_env .job_id is None
65+ assert run_env .message == "excellent adventure"
6666
6767def test_detect_env_with_circle_ci_env_vars_returns_the_correct_environment ():
6868 build_num = str (randint (0 , 1000 ))
@@ -79,31 +79,31 @@ def test_detect_env_with_circle_ci_env_vars_returns_the_correct_environment():
7979 }
8080
8181 with mock .patch .dict (os .environ , env , clear = True ):
82- runtime_env = detect_env ()
82+ run_env = detect_env ()
8383
84- assert runtime_env .ci == "circleci"
85- assert runtime_env .key == f"{ workflow_id } -{ build_num } "
86- assert runtime_env .url == "https://example.test/circle"
87- assert runtime_env .branch == "rufus"
88- assert runtime_env .commit_sha == commit
89- assert runtime_env .number == build_num
90- assert runtime_env .job_id is None
91- assert runtime_env .message == "excellent adventure"
84+ assert run_env .ci == "circleci"
85+ assert run_env .key == f"{ workflow_id } -{ build_num } "
86+ assert run_env .url == "https://example.test/circle"
87+ assert run_env .branch == "rufus"
88+ assert run_env .commit_sha == commit
89+ assert run_env .number == build_num
90+ assert run_env .job_id is None
91+ assert run_env .message == "excellent adventure"
9292
9393def test_detect_env_with_generic_env_vars ():
9494 env = {}
9595
9696 with mock .patch .dict (os .environ , env , clear = True ):
97- runtime_env = detect_env ()
98-
99- assert runtime_env .ci == "generic"
100- assert UUID (runtime_env .key )
101- assert runtime_env .url is None
102- assert runtime_env .branch is None
103- assert runtime_env .commit_sha is None
104- assert runtime_env .number is None
105- assert runtime_env .job_id is None
106- assert runtime_env .message is None
97+ run_env = detect_env ()
98+
99+ assert run_env .ci == "generic"
100+ assert UUID (run_env .key )
101+ assert run_env .url is None
102+ assert run_env .branch is None
103+ assert run_env .commit_sha is None
104+ assert run_env .number is None
105+ assert run_env .job_id is None
106+ assert run_env .message is None
107107
108108def test_env_as_json (fake_env ):
109109 json = fake_env .as_json ()
0 commit comments