(dotenv_file)
| 139 | |
| 140 | |
| 141 | def test_unset_with_value(dotenv_file): |
| 142 | logger = logging.getLogger("dotenv.main") |
| 143 | with open(dotenv_file, "w") as f: |
| 144 | f.write("a=b\nc=d") |
| 145 | |
| 146 | with mock.patch.object(logger, "warning") as mock_warning: |
| 147 | result = dotenv.unset_key(dotenv_file, "a") |
| 148 | |
| 149 | assert result == (True, "a") |
| 150 | with open(dotenv_file, "r") as f: |
| 151 | assert f.read() == "c=d" |
| 152 | mock_warning.assert_not_called() |
| 153 | |
| 154 | |
| 155 | def test_unset_no_value(dotenv_file): |