Skip to content

Commit

Permalink
Use Path objects in test_register. Ref #232.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Mar 2, 2024
1 parent d3f79e2 commit 8b7cee8
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions distutils/tests/test_register.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
"""Tests for distutils.command.register."""

import os
import getpass
import os
import pathlib
import urllib

from distutils.command import register as register_module
Expand Down Expand Up @@ -126,16 +127,8 @@ def test_create_pypirc(self):
finally:
del register_module.input

# we should have a brand new .pypirc file
assert os.path.exists(self.rc)

# with the content similar to WANTED_PYPIRC
f = open(self.rc)
try:
content = f.read()
assert content == WANTED_PYPIRC
finally:
f.close()
# A new .pypirc file should contain WANTED_PYPIRC
assert pathlib.Path(self.rc).read_text(encoding='utf-8') == WANTED_PYPIRC

# now let's make sure the .pypirc file generated
# really works : we shouldn't be asked anything
Expand Down

0 comments on commit 8b7cee8

Please sign in to comment.