(tmp_path, request)
| 885 | |
| 886 | @pytest.mark.skipif(sys.platform != "darwin", reason="macOS only") |
| 887 | def test_example_osxpkg(tmp_path, request): |
| 888 | input_path = _example_path("osxpkg") |
| 889 | ownership_test_files_home = [ |
| 890 | ".bash_profile", |
| 891 | ".conda", |
| 892 | ".condarc", |
| 893 | ".config", |
| 894 | ".config/fish", |
| 895 | ".config/fish/fish.config", |
| 896 | ".config/powershell", |
| 897 | ".config/powershell/profile.ps1", |
| 898 | ".tcshrc", |
| 899 | ".xonshrc", |
| 900 | ".zshrc", |
| 901 | ] |
| 902 | ownership_test_files_home = [Path.home() / file for file in ownership_test_files_home] |
| 903 | # getpass.getuser is more reliable than os.getlogin: |
| 904 | # https://docs.python.org/3/library/os.html#os.getlogin |
| 905 | expected_owner = getpass.getuser() |
| 906 | for installer, install_dir in create_installer(input_path, tmp_path): |
| 907 | _run_installer(input_path, installer, install_dir, request=request) |
| 908 | expected = {} |
| 909 | found = {} |
| 910 | for file in ownership_test_files_home: |
| 911 | if not file.exists(): |
| 912 | continue |
| 913 | expected[file] = expected_owner |
| 914 | found[file] = file.owner() |
| 915 | assert expected == found |
| 916 | |
| 917 | |
| 918 | @pytest.mark.skipif(sys.platform != "darwin", reason="macOS only") |
nothing calls this directly
no test coverage detected