Skip to content

Commit

Permalink
Rely on tree builder. Ref #232.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaraco committed Mar 2, 2024
1 parent 433bb4a commit b6f0ec3
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions distutils/tests/test_text_file.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
"""Tests for distutils.text_file."""

import os
import jaraco.path
import path

from distutils.text_file import TextFile
from distutils.tests import support

Expand Down Expand Up @@ -53,13 +55,9 @@ def test_input(count, description, file, expected_result):
result = file.readlines()
assert result == expected_result

tmpdir = self.mkdtemp()
filename = os.path.join(tmpdir, "test.txt")
out_file = open(filename, "w")
try:
out_file.write(TEST_DATA)
finally:
out_file.close()
tmp_path = path.Path(self.mkdtemp())
filename = tmp_path / 'test.txt'
jaraco.path.build({filename.name: TEST_DATA}, tmp_path)

in_file = TextFile(
filename, strip_comments=0, skip_blanks=0, lstrip_ws=0, rstrip_ws=0
Expand Down

0 comments on commit b6f0ec3

Please sign in to comment.