Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Nov 7, 2023
1 parent 132c8a3 commit 774f6cf
Showing 1 changed file with 5 additions and 16 deletions.
21 changes: 5 additions & 16 deletions src/towncrier/test/test_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,6 @@ def test_projectless_changelog(self, runner):
with open("foo/newsfragments/124.feature.rst", "w") as f:
f.write("Extends levitation")


result = runner.invoke(
_main,
[
Expand Down Expand Up @@ -575,9 +574,7 @@ def test_projectless_changelog(self, runner):
).lstrip(),
)

@with_isolated_simple_project(
config="[tool.towncrier]\n" 'version = "7.8.9"\n'
)
@with_isolated_simple_project(config="[tool.towncrier]\n" 'version = "7.8.9"\n')
def test_version_in_config(self, runner):
"""The calling towncrier with version defined in configfile.
Expand All @@ -588,7 +585,6 @@ def test_version_in_config(self, runner):
with open("newsfragments/123.feature", "w") as f:
f.write("Adds levitation")


result = runner.invoke(_main, ["--date", "01-01-2001", "--draft"])

self.assertEqual(0, result.exit_code, result.output)
Expand Down Expand Up @@ -616,9 +612,7 @@ def test_version_in_config(self, runner):
).lstrip(),
)

@with_isolated_simple_project(
config="[tool.towncrier]\n" 'name = "ImGoProject"\n'
)
@with_isolated_simple_project(config="[tool.towncrier]\n" 'name = "ImGoProject"\n')
def test_project_name_in_config(self, runner):
"""The calling towncrier with project name defined in configfile.
Expand All @@ -629,7 +623,6 @@ def test_project_name_in_config(self, runner):
with open("newsfragments/123.feature", "w") as f:
f.write("Adds levitation")


result = runner.invoke(
_main, ["--version", "7.8.9", "--date", "01-01-2001", "--draft"]
)
Expand Down Expand Up @@ -673,7 +666,6 @@ def test_no_package_changelog(self, runner):
with open("newsfragments/123.feature", "w") as f:
f.write("Adds levitation")


result = runner.invoke(
_main, ["--version", "7.8.9", "--date", "01-01-2001", "--draft"]
)
Expand Down Expand Up @@ -718,6 +710,7 @@ def test_release_notes_in_separate_files(self, runner):
in a separate file.
The name of the file is defined by the `filename` configuration value.
"""

def do_build_once_with(version, fragment_file, fragment):
with open(f"newsfragments/{fragment_file}", "w") as f:
f.write(fragment)
Expand All @@ -740,9 +733,7 @@ def do_build_once_with(version, fragment_file, fragment):

results = []
os.mkdir("newsfragments")
results.append(
do_build_once_with("7.8.9", "123.feature", "Adds levitation")
)
results.append(do_build_once_with("7.8.9", "123.feature", "Adds levitation"))
results.append(do_build_once_with("7.9.0", "456.bugfix", "Adds catapult"))

self.assertEqual(0, results[0].exit_code, results[0].output)
Expand Down Expand Up @@ -788,9 +779,7 @@ def do_build_once_with(version, fragment_file, fragment):
).lstrip(),
)

@with_isolated_simple_project(
config='[tool.towncrier]\n singlefile="fail!"\n'
)
@with_isolated_simple_project(config='[tool.towncrier]\n singlefile="fail!"\n')
def test_singlefile_errors_and_explains_cleanly(self, runner):
"""
Failure to find the configuration file results in a clean explanation
Expand Down

0 comments on commit 774f6cf

Please sign in to comment.