Skip to content

Commit

Permalink
Simplify test and fragment
Browse files Browse the repository at this point in the history
  • Loading branch information
SmileyChris committed May 7, 2023
1 parent d64737b commit 887937b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/towncrier/newsfragments/507.misc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
Provide a friendly message if --version option is required (for non-Python projects that don't explicitly provide the version in the config)
A friendly message is now provided, when it's necessary to pass the ``--version`` option explicitly.
5 changes: 3 additions & 2 deletions src/towncrier/test/test_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -517,9 +517,10 @@ def test_needs_version(self, runner: CliRunner):
If the configuration file doesn't specify a version or a package, the version
option is required.
"""
with open("towncrier.toml", "w") as f:
f.write("[tool.towncrier]")
write("towncrier.toml", "[tool.towncrier]")

result = runner.invoke(_main, ["--draft"], catch_exceptions=False)

self.assertEqual(2, result.exit_code)
self.assertIn("Error: '--version' is required", result.output)

Expand Down

0 comments on commit 887937b

Please sign in to comment.