(pytester: Pytester)
| 716 | |
| 717 | |
| 718 | def test_spawn_uses_tmphome(pytester: Pytester) -> None: |
| 719 | tmphome = str(pytester.path) |
| 720 | assert os.environ.get("HOME") == tmphome |
| 721 | |
| 722 | pytester._monkeypatch.setenv("CUSTOMENV", "42") |
| 723 | |
| 724 | p1 = pytester.makepyfile( |
| 725 | """ |
| 726 | import os |
| 727 | |
| 728 | def test(): |
| 729 | assert os.environ["HOME"] == {tmphome!r} |
| 730 | assert os.environ["CUSTOMENV"] == "42" |
| 731 | """.format( |
| 732 | tmphome=tmphome |
| 733 | ) |
| 734 | ) |
| 735 | child = pytester.spawn_pytest(str(p1)) |
| 736 | out = child.read() |
| 737 | assert child.wait() == 0, out.decode("utf8") |
| 738 | |
| 739 | |
| 740 | def test_run_result_repr() -> None: |
nothing calls this directly
no test coverage detected