Skip to content

Commit

Permalink
Fix environ setting on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
DRMacIver committed Oct 31, 2024
1 parent e8bce25 commit 6574f59
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions hypothesis-python/tests/cover/test_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
# obtain one at https://mozilla.org/MPL/2.0/.

import datetime
import os
import subprocess
import sys
from unittest import TestCase
Expand Down Expand Up @@ -520,14 +521,17 @@ def test_deprecated_settings_not_in_settings_all_list():


def test_check_defaults_to_derandomize_when_running_on_ci():
env = dict(os.environ)
env["CI"] = "true"

assert (
subprocess.check_output(
[
sys.executable,
"-c",
"from hypothesis import settings\nprint(settings().derandomize)",
],
env={"CI": "true"},
env=env,
text=True,
encoding="utf-8",
).strip()
Expand All @@ -536,14 +540,17 @@ def test_check_defaults_to_derandomize_when_running_on_ci():


def test_check_defaults_to_randomize_when_not_running_on_ci():
env = dict(os.environ)
env.pop("CI", None)
env.pop("TF_BUILD", None)
assert (
subprocess.check_output(
[
sys.executable,
"-c",
"from hypothesis import settings\nprint(settings().derandomize)",
],
env={},
env=env,
text=True,
encoding="utf-8",
).strip()
Expand Down

0 comments on commit 6574f59

Please sign in to comment.