We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent eebb121 commit dc7e309Copy full SHA for dc7e309
distutils/tests/test_config.py
@@ -1,6 +1,7 @@
1
"""Tests for distutils.pypirc.pypirc."""
2
3
import os
4
+import pathlib
5
from distutils.tests import support
6
7
import pytest
@@ -91,12 +92,7 @@ def test_server_empty_registration(self):
91
92
assert not os.path.exists(rc)
93
cmd._store_pypirc('tarek', 'xxx')
94
assert os.path.exists(rc)
- f = open(rc)
95
- try:
96
- content = f.read()
97
- assert content == WANTED
98
- finally:
99
- f.close()
+ assert pathlib.Path(rc).read_text(encoding='utf-8') == WANTED
100
101
def test_config_interpolation(self):
102
# using the % character in .pypirc should not raise an error (#20120)
0 commit comments