Skip to content

Commit 571f6ae

Browse files
committed
Use "coincidence" for the tests
1 parent f2ece4e commit 571f6ae

File tree

3 files changed

+27
-29
lines changed

3 files changed

+27
-29
lines changed

tests/conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
pytest_plugins = ("domdf_python_tools.testing", )
1+
pytest_plugins = ("coincidence", )

tests/test_pointless_checker.py

Lines changed: 4 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
# stdlib
2-
import pathlib
3-
import tempfile
1+
# 3rd party
2+
from coincidence.regressions import AdvancedFileRegressionFixture
43

54
# this package
65
from notebook2script.pointless import Pointless
76

87

9-
def test_pointless_checker(tmp_path):
8+
def test_pointless_checker(tmp_path, advanced_file_regression: AdvancedFileRegressionFixture):
109
# Make a file with some "pointless" statements
1110

1211
outfile = tmp_path / "test_script.py"
@@ -43,27 +42,4 @@ def test_pointless_checker(tmp_path):
4342

4443
linter.process_file(outfile)
4544

46-
assert outfile.read_text() == """\
47-
#!/use/bin/python3
48-
49-
# Based on https://realpython.com/how-to-use-numpy-arange/
50-
51-
import numpy as np
52-
53-
np.arange(start=1, stop=10, step=3)
54-
55-
np.arange(start=1, stop=10)
56-
57-
np.arange(
58-
start=1,
59-
stop=10,
60-
step=1
61-
)
62-
63-
np.arange(
64-
start=1, stop=10, step=1
65-
)
66-
67-
data = np.arange(10)
68-
print(data)
69-
"""
45+
advanced_file_regression.check_file(outfile)
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/use/bin/python3
2+
3+
# Based on https://realpython.com/how-to-use-numpy-arange/
4+
5+
import numpy as np
6+
7+
np.arange(start=1, stop=10, step=3)
8+
9+
np.arange(start=1, stop=10)
10+
11+
np.arange(
12+
start=1,
13+
stop=10,
14+
step=1
15+
)
16+
17+
np.arange(
18+
start=1, stop=10, step=1
19+
)
20+
21+
data = np.arange(10)
22+
print(data)

0 commit comments

Comments
 (0)