Skip to content

Commit cef3741

Browse files
authored
Update test_toml_file.py (#403)
1 parent b73d192 commit cef3741

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

tests/test_toml_file.py

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ def test_toml_file(example):
2424
assert f.write(original_content)
2525

2626

27-
def test_keep_old_eol(tmpdir):
28-
toml_path = str(tmpdir / "pyproject.toml")
27+
def test_keep_old_eol(tmp_path):
28+
toml_path = tmp_path / "pyproject.toml"
2929
with open(toml_path, "wb+") as f:
3030
f.write(b"a = 1\r\nb = 2\r\n")
3131

@@ -38,8 +38,8 @@ def test_keep_old_eol(tmpdir):
3838
assert f.read() == b"a = 1\r\nb = 3\r\n"
3939

4040

41-
def test_keep_old_eol_2(tmpdir):
42-
toml_path = str(tmpdir / "pyproject.toml")
41+
def test_keep_old_eol_2(tmp_path):
42+
toml_path = tmp_path / "pyproject.toml"
4343
with open(toml_path, "wb+") as f:
4444
f.write(b"a = 1\nb = 2\n")
4545

@@ -52,8 +52,8 @@ def test_keep_old_eol_2(tmpdir):
5252
assert f.read() == b"a = 1\nb = 3\n"
5353

5454

55-
def test_mixed_eol(tmpdir):
56-
toml_path = str(tmpdir / "pyproject.toml")
55+
def test_mixed_eol(tmp_path):
56+
toml_path = tmp_path / "pyproject.toml"
5757
with open(toml_path, "wb+") as f:
5858
f.write(b"a = 1\r\nrb = 2\n")
5959

@@ -64,8 +64,8 @@ def test_mixed_eol(tmpdir):
6464
assert f.read() == b"a = 1\r\nrb = 2\n"
6565

6666

67-
def test_consistent_eol(tmpdir):
68-
toml_path = str(tmpdir / "pyproject.toml")
67+
def test_consistent_eol(tmp_path):
68+
toml_path = tmp_path / "pyproject.toml"
6969
with open(toml_path, "wb+") as f:
7070
f.write(b"a = 1\r\nb = 2\r\n")
7171

@@ -78,8 +78,8 @@ def test_consistent_eol(tmpdir):
7878
assert f.read() == b"a = 1\r\nb = 2\r\nc = 3\r\n"
7979

8080

81-
def test_consistent_eol_2(tmpdir):
82-
toml_path = str(tmpdir / "pyproject.toml")
81+
def test_consistent_eol_2(tmp_path):
82+
toml_path = tmp_path / "pyproject.toml"
8383
with open(toml_path, "wb+") as f:
8484
f.write(b"a = 1\nb = 2\n")
8585

@@ -93,8 +93,8 @@ def test_consistent_eol_2(tmpdir):
9393
assert f.read() == b"a = 1\nb = 2\nc = 3\n"
9494

9595

96-
def test_default_eol_is_os_linesep(tmpdir):
97-
toml_path = str(tmpdir / "pyproject.toml")
96+
def test_default_eol_is_os_linesep(tmp_path):
97+
toml_path = tmp_path / "pyproject.toml"
9898
f = TOMLFile(toml_path)
9999
content = TOMLDocument()
100100
content.append("a", 1)
@@ -107,8 +107,8 @@ def test_default_eol_is_os_linesep(tmpdir):
107107
assert f.read() == b"a = 1" + linesep + b"b = 2" + linesep
108108

109109

110-
def test_readwrite_eol_windows(tmpdir):
111-
toml_path = str(tmpdir / "pyproject.toml")
110+
def test_readwrite_eol_windows(tmp_path):
111+
toml_path = tmp_path / "pyproject.toml"
112112
doc = TOMLDocument()
113113
doc.add("a", 1)
114114
f = TOMLFile(toml_path)

0 commit comments

Comments
 (0)